dplassgit / d2lang

D2 is a strongly-typed, statically-typed, (mostly) inferred-type compiled language.
MIT License
6 stars 0 forks source link

If a proc references a global that is defined after the proc, it gives a type check error. #212

Closed dplassgit closed 1 year ago

dplassgit commented 1 year ago

As summary

dplassgit commented 1 year ago

This may be WAI (i.e., you must define variables before they're used), or it may be fixed by the fix in issue #169 ("Scopes are broken")

dplassgit commented 1 year ago

After further thought, this is WAI. Just like any other variable that needs to be set before referenced.

dplassgit commented 1 year ago

After further thought, this is WAI. Just like any other variable that needs to be set before referenced.

(Except for procedures and record definitions...)