diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2020-10-28 23:09:48 +0000 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2020-11-02 08:23:42 +0000 |
commit | 791cb337549df002ff4323299e6baf825fe994f4 (patch) | |
tree | ba29187925df87daa5fcfa3c10a94179c720676a /compiler/GHC/Parser | |
parent | e63db32c7eb089985a1a7279a0a886a32d70ac0e (diff) | |
download | haskell-wip/T18888.tar.gz |
Restrict Linear arrow %1 to exactly literal 1 onlywip/T18888
This disallows `a %001 -> b`, and makes sure the type literal is
printed from its SourceText so it is clear why.
Closes #18888
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index 84aa3e09bc..e95abd6597 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -2620,7 +2620,8 @@ mkLHsOpTy x op y = in L loc (mkHsOpTy x op y) mkMultTy :: IsUnicodeSyntax -> Located Token -> LHsType GhcPs -> (HsArrow GhcPs, AddAnn) -mkMultTy u tok t@(L _ (HsTyLit _ (HsNumTy _ 1))) +mkMultTy u tok t@(L _ (HsTyLit _ (HsNumTy (SourceText "1") 1))) + -- See #18888 for the use of (SourceText "1") above = (HsLinearArrow u, AddAnn AnnPercentOne (combineLocs tok t)) mkMultTy u tok t = (HsExplicitMult u t, AddAnn AnnPercent (getLoc tok)) |