Declaring and initializing arrays doesn't work
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 271
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 173
Description
Original issue: https://gitlab.com/lfortran/lfortran/-/issues/205
Reported by @ milancurcic (thanks!):
$ cat test_array.f90
program array
real :: a(5)
a = 1
print *, a
end program array
$ ./lfortran --static test_array.f90
$ ./a.out
0.000000
This should give an error that it is not supported, or it should work. It should never compile without an error and then fail at runtime.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example in test_array.f90 with ./lfortran --static test_array.f90, then inspect the compiler path handling real :: a(5) and a = 1. Done means the command either rejects this unsupported array initialization with an error or produces the expected initialized output instead of silently generating an executable that prints zeros.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, fortran
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100