summaryrefslogtreecommitdiff
path: root/src/Compile.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-03-15 11:32:34 +0100
committerTom Smeding <tom@tomsmeding.com>2025-03-15 11:32:34 +0100
commit6da98aedf2f28ec8848d1cb8f5605b0c7e64d644 (patch)
treec5723c920a200c001fd5f156f5f80f4a6eb11455 /src/Compile.hs
parent095e7be937c2414cd34eb6288bd2c0856be63def (diff)
Complete accumulator revamp!
Diffstat (limited to 'src/Compile.hs')
-rw-r--r--src/Compile.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Compile.hs b/src/Compile.hs
index 424b28d..5c9d1a2 100644
--- a/src/Compile.hs
+++ b/src/Compile.hs
@@ -755,12 +755,10 @@ compile' env = \case
emit $ SVarDecl True (repSTy t2) name2 e2'
compile' (Const name2 `SCons` Const name1 `SCons` SNil) earg
- EWith _ e1 e2 -> do
- let t = typeOf e1
-
+ EWith _ t e1 e2 -> do
e1' <- compile' env e1
name1 <- genName
- emit $ SVarDecl True (repSTy t) name1 e1'
+ emit $ SVarDecl True (repSTy (typeOf e1)) name1 e1'
mcopy <- copyForWriting t name1
accname <- genName' "accum"