fortran-src
fortran-src copied to clipboard
Implicit typing not taken into account by
Given the following implicit.f
:
PROGRAM IMPLICIT
IX = 0
IY = 0
END
then fortran-src -t implicit.f
cannot calculate any types, but this should be inferring via the implicit types scheme. (We should also check fortran-vars
behaviour on this).
We could add an entry to the TypeEnv
whenever we find an assignment to a variable that isn't yet defined and matches an implicit typing rule.
If we have some support for implicit typing, it would be nice to process IMPLICIT
statements also, and expose options similar to compilers for applying IMPLICIT NONE
by default (gfortran's -fimplicit-none
). I'm not immediately sure how to implement scoping though. Maybe bolt a reader monad on top of the infer state, that follows scoping unit rules?