Semantics: Array Initializer Expressions
TODO: Fill this out
lfortran --show-stacktrace --show-asr -c states.f90
Semantic error: ArrayInitalizer expressions can only be assigned array references
However, gfortran -c states.f90 -o states.o
works fine.
More precisely:
lfortran -c states.f90
input:35:9 semantic error: ArrayInitalizer expressions can only be assigned array references
no = (/ 1 /)
^~~~~~~~~~~~
The offending code can be exemplified by the following:
module arrayBug
implicit none
private
public test_bug
contains
subroutine test_bug(x)
integer, pointer :: x(:)
integer :: n
n = 1
allocate(x(1))
x = (/ 1 /)
end subroutine test_bug
end module arrayBug
Which should compile correctly.
Edited by Rohit Goswami