summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-05-07 08:56:30 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-08 02:01:54 -0400
commit0eeb4cfad732d0b9b278c2274cb6db9633f9d3b5 (patch)
treeb1a99dee78788fe2537f5c82570a4240196845fa /compiler/parser
parent786e665b8dac5430c02089b39f7cb7572a5254d8 (diff)
downloadhaskell-0eeb4cfad732d0b9b278c2274cb6db9633f9d3b5.tar.gz
Fix #16632 by using the correct SrcSpan in checkTyClHdr
`checkTyClHdr`'s case for `HsTyVar` was grabbing the wrong `SrcSpan`, which lead to error messages pointing to the wrong location. Easily fixed.
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/RdrHsSyn.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index 7c457f83d1..156931dc9f 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -955,8 +955,8 @@ checkTyClHdr is_cls ty
; let name = mkOccName tcClsName (starSym isUni)
; return (cL l (Unqual name), acc, fix, (ann ++ mkParensApiAnn lp)) }
- go l (HsTyVar _ _ (dL->L _ tc)) acc ann fix
- | isRdrTc tc = return (cL l tc, acc, fix, ann)
+ go _ (HsTyVar _ _ ltc@(dL->L _ tc)) acc ann fix
+ | isRdrTc tc = return (ltc, acc, fix, ann)
go _ (HsOpTy _ t1 ltc@(dL->L _ tc) t2) acc ann _fix
| isRdrTc tc = return (ltc, HsValArg t1:HsValArg t2:acc, Infix, ann)
go l (HsParTy _ ty) acc ann fix = goL ty acc (ann ++mkParensApiAnn l) fix