Skip to content

Commit

Permalink
Merge pull request #1504 from actonlang/1500-fix-tuple-selection-cast
Browse files Browse the repository at this point in the history
Added necessary cast...
  • Loading branch information
nordlander authored Sep 22, 2023
2 parents f470a32 + 3d3f7af commit 4ea0fa9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/Acton/CodeGen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ instance Gen Expr where
gen env (TApp _ e ts) = genInst env ts e
gen env (IsInstance _ e c) = gen env primISINSTANCE <> parens (gen env e <> comma <+> genQName env c)
gen env (Dot _ e n) = genDot env [] e n
gen env (DotI _ e i) = gen env e <> text "->" <> gen env componentsKW <> brackets (pretty i)
gen env e0@(DotI _ e i) = parens $ parens (gen env t) <> gen env e <> text "->" <> gen env componentsKW <> brackets (pretty i)
where t = typeOf env e0
gen env (RestI _ e i) = gen env eNone <> semi <+> text "// CodeGen for tuple tail not implemented"
gen env (Tuple _ p KwdNil)
| n == 0 = gen env primNEWTUPLE0
Expand Down

0 comments on commit 4ea0fa9

Please sign in to comment.