Skip to content

Commit

Permalink
fix scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Dec 7, 2024
1 parent 6b5ab5f commit 4c243b2
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,15 +745,13 @@ lookupSymbolAux modules final = do
path1 = topPath ^. modulePathDir ++ [topPath ^. modulePathName]
path2 = path0 ^. S.absLocalPath
pref = commonPrefix path2 modules
if
| isPrefixOf path1 modules -> do
let modules' = drop (length path1) modules
pref' = commonPrefix path2 modules'
lookPrefix pref' path2 modules'
| not (null pref) ->
lookPrefix pref path2 modules
| otherwise ->
lookupLocalSymbolAux (const True) modules final
when (isPrefixOf path1 modules) $ do
let modules' = drop (length path1) modules
pref' = commonPrefix path2 modules'
lookPrefix pref' path2 modules'
when (not (null pref)) $
lookPrefix pref path2 modules
lookupLocalSymbolAux (const True) modules final

lookPrefix :: [Symbol] -> [Symbol] -> [Symbol] -> Sem r ()
lookPrefix pref path modules' = do
Expand Down

0 comments on commit 4c243b2

Please sign in to comment.