Issue is raised as PR 47339.
Following test case should generate compile time error for invalid selector at line #4 and #9 :
R1105 selector is expr
or variable
C1103 (R1105) variable shall not be a coindexed object.
[root@localhost flang]# cat -n /root/LLVM/selecttype_coarray.f90
1 class(*),allocatable :: calc[:] 2 integer :: icoa[*] 3 4 associate(sel=>icoa[2]) 5 end associate 6 7 icoa = 2 8 allocate(integer::calc[*]) 9 select type(sel=>calc[2]) 10 type is(integer) 11 sel = 2 12 end select 13 end
If details.expr() is vacant, so will GetCurrentAssociation().selector.expr be, yes? I think that you can use one or the other. This would be shorter: