tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
47 stars 11 forks source link

check-condition failure if using `io.out.env` #3769

Closed fridis closed 3 weeks ago

fridis commented 2 months ago

Try this:

 > PRECONDITIONS=true POSTCONDITIONS=true ./build/bin/fz -e "_ := io.out.env"

error 1: java.lang.Error: check-condition failed: Clazzes.java:841 "(Errors.any() || i < afs.length);"
    at dev.flang.util.ANY.check(ANY.java:440)
    at dev.flang.air.Clazzes.findClazzes(Clazzes.java:841)
    at dev.flang.air.Clazz$EV.action(Clazz.java:138)
    at dev.flang.ast.Expr.visitExpressions(Expr.java:329)
    at dev.flang.ast.AbstractCall.visitExpressions(AbstractCall.java:98)
    at dev.flang.ast.AbstractFeature.visitExpressions(AbstractFeature.java:1589)
    at dev.flang.air.Clazz.inspectCode(Clazz.java:1520)
    at dev.flang.air.Clazz.findAllClasses(Clazz.java:1564)
    at dev.flang.air.Clazzes.findAllClasses(Clazzes.java:469)
    at dev.flang.fuir.FUIR.<init>(FUIR.java:206)
    at dev.flang.opt.Optimizer.fuir(Optimizer.java:77)
    at dev.flang.tools.Fuzion$Backend.processFrontEnd(Fuzion.java:507)
    at dev.flang.tools.Fuzion.lambda$parseArgsForBackend$4(Fuzion.java:1072)
    at dev.flang.tools.Tool.lambda$run$0(Tool.java:142)
    at dev.flang.util.Errors.runAndExit(Errors.java:895)
    at dev.flang.tools.Tool.run(Tool.java:142)
    at dev.flang.tools.Fuzion.main(Fuzion.java:627)

work correctly without checks, i.e, DFA complains about not installed effect:

 > ./build/bin/fz -e "_ := io.out.env"

command line:1:6: error 1: Failed to verify that effect 'io.out' is installed in current environment.
_ := io.out.env

Callchain that lead to this point:

effect environment '--empty--' for call to 'universe'
effect environment '--empty--' at program entry

one error.