1
1
mirror of https://github.com/github/semantic.git synced 2024-12-15 01:51:39 +03:00

Correct associatedScope using >>=.

This commit is contained in:
Rob Rix 2018-12-05 14:48:44 -05:00
parent 3a3fa0c541
commit 98107e05be

View File

@ -270,7 +270,7 @@ scopeOfDeclaration Declaration{..} g@ScopeGraph{..} = go (Map.keys graph)
associatedScope :: Ord scope => Declaration -> ScopeGraph scope -> Maybe scope
associatedScope Declaration{..} g@ScopeGraph{..} = go (Map.keys graph)
where
go = foldr (\ scope -> (snd . snd . fst <$> lookupDeclaration unDeclaration scope g <|>)) Nothing
go = foldr (\ scope -> ((lookupDeclaration unDeclaration scope g >>= snd . snd . fst) <|>)) Nothing
newtype Reference = Reference { unReference :: Name }
deriving (Eq, Ord, Show, Generic, NFData)