fortran-src icon indicating copy to clipboard operation
fortran-src copied to clipboard

Implicit typing not taken into account by

Open dorchard opened this issue 3 years ago • 1 comments

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).

dorchard avatar Aug 31 '21 10:08 dorchard

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?

raehik avatar Sep 01 '21 12:09 raehik