Commit e996e85f authored by Ben Gamari's avatar Ben Gamari 🐢

RdrHsSyn: Only suggest `type` qualification when appropriate

This suggestion only applies to operators.
parent 53f26f5a
......@@ -1406,11 +1406,12 @@ mkModuleImpExp n@(L l name) subs =
nameT =
if isVarNameSpace (rdrNameSpace name)
then parseErrorSDoc l
(text "Expecting a type constructor but found a variable."
(text "Expecting a type constructor but found a variable,"
<+> quotes (ppr name) <> text "."
$$ if isSymOcc $ rdrNameOcc name
then text "If" <+> quotes (ppr name) <+> text "is a type constructor"
else empty
<+> text "then enable ExplicitNamespaces and use the 'type' keyword.")
<+> text "then enable ExplicitNamespaces and use the 'type' keyword."
else empty)
else return $ name
mkTypeImpExp :: Located RdrName -- TcCls or Var name space
......
T11432.hs:7:16: error:
Expecting a type constructor but found a variable.
If ‘-.->’ is a type constructor then enable ExplicitNamespaces and use the 'type' keyword.
Expecting a type constructor but found a variable, ‘-.->’.
If ‘-.->’ is a type constructor then enable ExplicitNamespaces and use the 'type' keyword.
T11432a.hs:7:17: error:
Expecting a type constructor but found a variable.
Expecting a type constructor but found a variable, ‘-.->’.
If ‘-.->’ is a type constructor then enable ExplicitNamespaces and use the 'type' keyword.
T12026.hs:3:17: error:
Expecting a type constructor but found a variable.
If ‘map’ is a type constructor then enable ExplicitNamespaces and use the 'type' keyword.
Expecting a type constructor but found a variable, ‘map’.
mod89.hs:5:16: error:
Expecting a type constructor but found a variable.
If ‘map’ is a type constructor then enable ExplicitNamespaces and use the 'type' keyword.
Expecting a type constructor but found a variable, ‘map’.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment