From be44a501e0f23033e60a083f06458e7ccc1beb75 Mon Sep 17 00:00:00 2001 From: joshvera Date: Wed, 26 Sep 2018 13:57:46 -0500 Subject: [PATCH] currentScope' always returns an address now --- src/Control/Abstract/Primitive.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Control/Abstract/Primitive.hs b/src/Control/Abstract/Primitive.hs index db89cf805..b50e4697f 100644 --- a/src/Control/Abstract/Primitive.hs +++ b/src/Control/Abstract/Primitive.hs @@ -114,12 +114,10 @@ instance (Member (Reader ModuleInfo) effects, Member (Resumable (BaseError (Scop span <- ask @Span -- TODO: This span is probably wrong currentScope' <- currentScope address <- declare (Declaration name) span Nothing - let edges = maybe mempty (Map.singleton Lexical . pure) currentScope' + let edges = Map.singleton Lexical [ currentScope' ] functionScope <- newScope edges currentFrame' <- currentFrame - let frameEdges = case currentScope' of - Just scope -> Map.singleton Lexical (Map.singleton scope currentFrame') - Nothing -> mempty + let frameEdges = Map.singleton Lexical (Map.singleton currentScope' currentFrame') functionFrame <- newFrame functionScope frameEdges withScopeAndFrame functionFrame $ do function name vars lowerBound action