Skip to content

Handle trim(generic) in select type stmt #9328

@jinangshah21

Description

@jinangshah21

MRE:

program select_type_char_mre
    implicit none

    call print_any("  Hello World  ")

contains

    subroutine print_any(generic)
        class(*), intent(in) :: generic
        select type (generic)
        type is (character(len=*))
            print *, trim(generic)
        end select
    end subroutine print_any

end program select_type_char_mre

LFortran Error:

ASR verify pass error: Unexpected args, StringTrim expects (char) as arguments
  --> d.f90:12:22
   |
12 |             print *, trim(generic)
   |                      ^^^^^^^^^^^^^ failed here

Metadata

Metadata

Assignees

No one assigned

    Labels

    MCLI2Compiling MCLI2 library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions