Skip to content

Commit a782b34

Browse files
author
Philipp Schuster
committed
Properly annotate methods that are qualified because their class is qualified.
1 parent 4a17183 commit a782b34

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Language/Haskell/Names/Annotated.hs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ lookupName name scope = Scoped nameInfo (ann name) where
107107
nameInfo = case getL nameCtx scope of
108108

109109
ReferenceUV ->
110-
checkUniqueness (Global.lookupMethodOrAssociate qname globalTable) where
110+
checkUniqueness qname (Global.lookupMethodOrAssociate qname globalTable) where
111111
qname = qualifyName (getL instQual scope) name
112112

113113
SignatureV ->
114-
checkUniqueness (Global.lookupValue qname globalTable) where
114+
checkUniqueness qname (Global.lookupValue qname globalTable) where
115115
qname = qualifyName (Just (getL moduName scope)) name
116116

117117
BindingV -> ValueBinder
@@ -122,12 +122,10 @@ lookupName name scope = Scoped nameInfo (ann name) where
122122

123123
globalTable = getL gTable scope
124124

125-
unqualifiedQName = UnQual (ann name) name
126-
127-
checkUniqueness symbols = case symbols of
128-
[] -> ScopeError (ENotInScope unqualifiedQName)
129-
[symbol] -> GlobalSymbol symbol (sQName unqualifiedQName)
130-
_ -> ScopeError (EAmbiguous unqualifiedQName symbols)
125+
checkUniqueness qname symbols = case symbols of
126+
[] -> ScopeError (ENotInScope qname)
127+
[symbol] -> GlobalSymbol symbol (sQName qname)
128+
_ -> ScopeError (EAmbiguous qname symbols)
131129

132130

133131
qualifyName :: Maybe UnAnn.ModuleName -> Name l -> QName l

0 commit comments

Comments
 (0)