diff options
author | Cale Gibbard <cgibbard@gmail.com> | 2020-11-09 16:11:45 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-12-14 13:37:09 -0500 |
commit | c696bb2f4476e0ce4071e0d91687c1fe84405599 (patch) | |
tree | dc55fdaebbcd8dbd0c1f53c80214c2996c7f3f0a /compiler/GHC/Parser/Errors/Ppr.hs | |
parent | 78580ba3f99565b0aecb25c4206718d4c8a52317 (diff) | |
download | haskell-c696bb2f4476e0ce4071e0d91687c1fe84405599.tar.gz |
Implement type applications in patterns
The haddock submodule is also updated so that it understands the changes
to patterns.
Diffstat (limited to 'compiler/GHC/Parser/Errors/Ppr.hs')
-rw-r--r-- | compiler/GHC/Parser/Errors/Ppr.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Parser/Errors/Ppr.hs b/compiler/GHC/Parser/Errors/Ppr.hs index c4b411b1c3..a26f6809c6 100644 --- a/compiler/GHC/Parser/Errors/Ppr.hs +++ b/compiler/GHC/Parser/Errors/Ppr.hs @@ -263,9 +263,6 @@ pp_err = \case ErrIfTheElseInPat -> text "(if ... then ... else ...)-syntax in pattern" - ErrTypeAppInPat - -> text "Type applications in patterns are not yet supported" - ErrLambdaCaseInPat -> text "(\\case ...)-syntax in pattern" @@ -607,6 +604,8 @@ pp_hint = \case $$ if opIsAt fun then perhaps_as_pat else empty + TypeApplicationsInPatternsOnlyDataCons -> + text "Type applications in patterns are only allowed on data constructors." perhaps_as_pat :: SDoc perhaps_as_pat = text "Perhaps you meant an as-pattern, which must not be surrounded by whitespace" |