From 78d543c60ffa1c0ca5c19ba7f53d753e5a466e69 Mon Sep 17 00:00:00 2001 From: joshvera Date: Thu, 15 Nov 2018 14:39:59 -0500 Subject: [PATCH] Return the currentScope' if pathDeclarationScope is a DPath Co-Authored-By: Rick Winfrey --- src/Control/Abstract/ScopeGraph.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Control/Abstract/ScopeGraph.hs b/src/Control/Abstract/ScopeGraph.hs index ca41bddc6..09729124d 100644 --- a/src/Control/Abstract/ScopeGraph.hs +++ b/src/Control/Abstract/ScopeGraph.hs @@ -187,7 +187,10 @@ lookupDeclarationScope :: ( Member (Resumable (BaseError (ScopeError address))) , Ord address , Show address ) => Declaration -> Evaluator term address value m address -lookupDeclarationScope decl = maybeM (throwScopeError $ LookupDeclarationScopeError decl) . ScopeGraph.pathDeclarationScope =<< lookupScopePath decl +lookupDeclarationScope decl = do + path <- lookupScopePath decl + currentScope' <- currentScope + maybeM (throwScopeError $ LookupDeclarationScopeError decl) (ScopeGraph.pathDeclarationScope currentScope' path) associatedScope :: (Ord address, Member (State (ScopeGraph address)) sig, Carrier sig m) => Declaration -> Evaluator term address value m (Maybe address) associatedScope decl = ScopeGraph.associatedScope decl <$> get