Skip to content

Commit

Permalink
fix(codegen): Fix stringLength primitive not boxing integers
Browse files Browse the repository at this point in the history
  • Loading branch information
bristermitten committed May 31, 2024
1 parent 64edc03 commit 85fcf5a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Elara/Emit/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ generatePrimInstructions "stringLength" =
pure
[ ALoad 0
, InvokeVirtual (ClassInfoType "java.lang.String") "length" (MethodDescriptor [] (TypeReturn (PrimitiveFieldType JVM.Int)))
, InvokeStatic (ClassInfoType "java.lang.Integer") "valueOf" (MethodDescriptor [PrimitiveFieldType JVM.Int] (TypeReturn (ObjectFieldType "java.lang.Integer")))
]
generatePrimInstructions "unconsString" =
-- the rough impl equivalent here is
Expand Down

0 comments on commit 85fcf5a

Please sign in to comment.