-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The following code produces LECC runtime errors when run:
test :: (String, Int) -> Int;
public test !pair =
case pair of
(str, num) ->
let
result = 1 + num;
in
if num == 0 then
case Nothing of
Nothing ->
result;
else
result;
;
running: Cal.Test.Core.Prelude_Tests.test ("foo", 1)
Error while executing: Fatal Executor error.
Caused by: java.lang.NoClassDefFoundError: org/openquark/cal_Cal_Test_Core_Prelude__Tests/Test, Detail: org/openquark/cal_Cal_Test_Core_Prelude__Tests/Test
With LECC source generation enabled:
Cal.Test.Core.Prelude_Tests:CAL: Compilation unsuccessful because of errors:
Error: Code generation aborted. Error generating code for: Cal.Test.Core.Prelude_Tests.test Detail: Unable to retrieve MachineFunction for Cal.Test.Core.Prelude_Tests.test$result$4. Caused by: org.openquark.cal.internal.machine.CodeGenerationException
A more complex version of the test:
test2 :: Int -> Map Int String;
public test2 !unused =
let
simpleAddToAccum :: Map Int String -> (String, Int) -> Map Int String;
simpleAddToAccum !accum inputVal =
case inputVal of
(val, ord) ->
let
defaultInsertResult :: Map Int String;
defaultInsertResult = Map.insert ord val accum;
in
if False then
case Nothing of
Nothing ->
defaultInsertResult;
else
defaultInsertResult;
;
in
simpleAddToAccum Map.empty ("test", 5);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels