Skip to content

Commit

Permalink
Added necessary cast when selecting from the completely generic tuple…
Browse files Browse the repository at this point in the history
… representation.
  • Loading branch information
nordlander committed Sep 22, 2023
1 parent f470a32 commit 3d3f7af
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 3d3f7af

Please sign in to comment.