You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Unit/_.kind2
data Unit
| new
// Unit/new.kind2
new: Unit = ~λP λnew new
// Something/_.kind2
Something : * = Unit
// main.kind2
main: Something = Unit/new
Checking all the files results in no error.
After compiling the main file with kind2 to-js main, the result is the following:
Because the identifiers are sorted alphabetically, const Something = Unit; comes before Unit is defined, which results in an error:
ReferenceError: Cannot access 'Unit' before initialization
Instead of sorting the identifier alphabetically, an alternative would to be sort them accordingly to the dependence tree, so that all dependencies are sorted before their dependents.
The text was updated successfully, but these errors were encountered:
Consider the following kind2 program:
Checking all the files results in no error.
After compiling the
main
file withkind2 to-js main
, the result is the following:Because the identifiers are sorted alphabetically,
const Something = Unit;
comes beforeUnit
is defined, which results in an error:Instead of sorting the identifier alphabetically, an alternative would to be sort them accordingly to the dependence tree, so that all dependencies are sorted before their dependents.
The text was updated successfully, but these errors were encountered: