[Git][ghc/ghc][wip/int-index/comment-illformed-type-pattern] Drop outdated comment on TcRnIllformedTypePattern
Vladislav Zavialov (@int-index)
gitlab at gitlab.haskell.org
Fri Mar 8 20:04:24 UTC 2024
Vladislav Zavialov pushed to branch wip/int-index/comment-illformed-type-pattern at Glasgow Haskell Compiler / GHC
Commits:
b79a9071 by Vladislav Zavialov at 2024-03-08T23:04:14+03:00
Drop outdated comment on TcRnIllformedTypePattern
This should have been done in 0f0c53a501b but I missed it.
- - - - -
6 changed files:
- compiler/GHC/Tc/Errors/Types.hs
- testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_pat.hs → testsuite/tests/vdq-rta/should_fail/T22326_fail_bang_pat.hs
- testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_pat.stderr → testsuite/tests/vdq-rta/should_fail/T22326_fail_bang_pat.stderr
- testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_arg.hs → testsuite/tests/vdq-rta/should_fail/T22326_fail_lam_arg.hs
- testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_arg.stderr → testsuite/tests/vdq-rta/should_fail/T22326_fail_lam_arg.stderr
- testsuite/tests/vdq-rta/should_fail/all.T
Changes:
=====================================
compiler/GHC/Tc/Errors/Types.hs
=====================================
@@ -4129,19 +4129,15 @@ data TcRnMessage where
corresponding to a required type argument (visible forall)
does not have a form that can be interpreted as a type pattern.
- At the moment, only patterns constructed using the @type@ keyword
- are considered well-formed, but this restriction will be relaxed
- when part 2 of GHC Proposal #281 is implemented.
-
Example:
vfun :: forall (a :: k) -> ()
- vfun x = ()
- -- ^
- -- expected `type x` instead of `x`
+ vfun !x = ()
+ -- ^^
+ -- bang-patterns not allowed as type patterns
Test cases:
- T22326_fail_raw_pat
+ T22326_fail_bang_pat
-}
TcRnIllformedTypePattern :: !(Pat GhcRn) -> TcRnMessage
@@ -4173,7 +4169,7 @@ data TcRnMessage where
-- lambdas not allowed in type arguments
Test cases:
- T22326_fail_raw_arg
+ T22326_fail_lam_arg
-}
TcRnIllformedTypeArgument :: !(LHsExpr GhcRn) -> TcRnMessage
=====================================
testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_pat.hs → testsuite/tests/vdq-rta/should_fail/T22326_fail_bang_pat.hs
=====================================
@@ -1,6 +1,6 @@
{-# LANGUAGE RequiredTypeArguments #-}
-module T22326_fail_raw_pat where
+module T22326_fail_bang_pat where
f :: forall (a :: k) -> ()
f !x = ()
\ No newline at end of file
=====================================
testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_pat.stderr → testsuite/tests/vdq-rta/should_fail/T22326_fail_bang_pat.stderr
=====================================
@@ -1,5 +1,5 @@
-T22326_fail_raw_pat.hs:6:3: error: [GHC-88754]
+T22326_fail_bang_pat.hs:6:3: error: [GHC-88754]
• Ill-formed type pattern: !x
• In the pattern: !x
In an equation for ‘f’: f !x = ()
=====================================
testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_arg.hs → testsuite/tests/vdq-rta/should_fail/T22326_fail_lam_arg.hs
=====================================
@@ -1,7 +1,7 @@
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE RequiredTypeArguments #-}
-module T22326_fail_raw_arg where
+module T22326_fail_lam_arg where
f :: forall (a :: k) -> ()
f (type _) = ()
=====================================
testsuite/tests/vdq-rta/should_fail/T22326_fail_raw_arg.stderr → testsuite/tests/vdq-rta/should_fail/T22326_fail_lam_arg.stderr
=====================================
@@ -1,5 +1,5 @@
-T22326_fail_raw_arg.hs:9:5: error: [GHC-29092]
+T22326_fail_lam_arg.hs:9:5: error: [GHC-29092]
• Ill-formed type argument: \ _ -> _
• In the expression: f (\ _ -> _)
In an equation for ‘x’: x = f (\ _ -> _)
=====================================
testsuite/tests/vdq-rta/should_fail/all.T
=====================================
@@ -3,8 +3,8 @@ test('T22326_fail_ext2', normal, compile_fail, [''])
test('T22326_fail_top', normal, compile_fail, [''])
test('T22326_fail_app', normal, compile_fail, [''])
test('T22326_fail_notInScope', normal, compile_fail, [''])
-test('T22326_fail_raw_pat', normal, compile_fail, [''])
-test('T22326_fail_raw_arg', normal, compile_fail, [''])
+test('T22326_fail_bang_pat', normal, compile_fail, [''])
+test('T22326_fail_lam_arg', normal, compile_fail, [''])
test('T22326_fail_pat', normal, compile_fail, [''])
test('T22326_fail_nonlinear', normal, compile_fail, [''])
test('T22326_fail_caseof', normal, compile_fail, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b79a9071bd9a8f1de378567320c112ea05822a1c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b79a9071bd9a8f1de378567320c112ea05822a1c
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240308/ab823e63/attachment-0001.html>
More information about the ghc-commits
mailing list