diff --git a/semantic-python/test-graphing/GraphTest.hs b/semantic-python/test-graphing/GraphTest.hs index 99b891b23..104bdbc2d 100644 --- a/semantic-python/test-graphing/GraphTest.hs +++ b/semantic-python/test-graphing/GraphTest.hs @@ -89,8 +89,7 @@ assertSimpleReference = do expectedReference :: ScopeGraphEff sig m => m Result expectedReference = do declare "x" (Props.Declaration ScopeGraph.Assignment ScopeGraph.Default Nothing (Span (Pos 0 0) (Pos 0 5))) - let refProperties = Props.Reference ScopeGraph.Assignment ScopeGraph.Default (Span (Pos 0 0) (Pos 0 1)) - reference "x" "x" refProperties + let refProperties = Props.Reference ScopeGraph.Identifier ScopeGraph.Default (Span (Pos 1 0) (Pos 1 1)) newReference "x" refProperties pure Complete diff --git a/semantic-scope-graph/src/Control/Effect/ScopeGraph.hs b/semantic-scope-graph/src/Control/Effect/ScopeGraph.hs index 17a59b0a5..554777a9a 100644 --- a/semantic-scope-graph/src/Control/Effect/ScopeGraph.hs +++ b/semantic-scope-graph/src/Control/Effect/ScopeGraph.hs @@ -150,7 +150,7 @@ newReference name props = do in (ScopeGraph.insertScope currentAddress scope' scopeGraph) scopeGraph <- get @(ScopeGraph.ScopeGraph Name) - case ((AdjacencyList.findPath (const Nothing) (ScopeGraph.Declaration name) currentAddress scopeGraph) :: Maybe (Scope.Path Name)) of + case AdjacencyList.findPath (const Nothing) (ScopeGraph.Declaration name) currentAddress scopeGraph of Just path -> modify (\scopeGraph -> insertRef' path scopeGraph) Nothing -> undefined -- maybe