Acknowledged
over 1 year ago

Compiler crashes when type check is enabled

When compiling my app (available here https://github.com/matco/badminton) with type check enabled (parameter -l set to 1, 2 or 3), the compiler crashes with the following error:

ERROR: class com.garmin.monkeybrains.compiler2.ir.expressions.ModuleAccess cannot be cast to class com.garmin.monkeybrains.compiler2.ir.values.PrimitiveValue (com.garmin.monkeybrains.compiler2.ir.expressions.ModuleAccess and com.garmin.monkeybrains.compiler2.ir.values.PrimitiveValue are in unnamed module of loader 'app')

The same app compiles perfectly when type check is disabled.

Steps to reproduce: 

  • Clone my app locally with git clone https://github.com/matco/badminton.git
  • Checkout one commit that triggers the error git checkout 44030067ea145b7952b050527a7a4474aaaead1e
  • Compile the app with java.exe -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar monkeybrains.jar -o bin/badminton.prg -f monkey.jungle -y developer_key -d fenix7_sim -w -l 1