`size()` not handled correctly for Arrays
- Reference Document -- J3/21-007 (Draft Fortran 202x)
As noted in #400 (closed) by Ondrej and in #401, the following minimum example can be used:
module A
contains
subroutine f(x)
integer, intent(in) :: x(:)
real :: E(size(x))
E = x
end subroutine
end module
The standard is a little hard to narrow down for this behaviour, and am happy to have a more concrete reference; however the expected behaviour is clear, it should take the size of x
and thus should be handled at the ASR level since lfortran
has concrete ASR representations in modules.
- : is R823 (deferred shape)
-
size is an intrinsic inquiry function defined at 16.9.192 with
SIZE (ARRAY [, DIM, KIND])
- @nncarlson pointed out that this is a specification expression defined in 10.1.11