diff options
Diffstat (limited to 'testsuite')
19 files changed, 125 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/T22513a.hs b/testsuite/tests/rename/should_compile/T22513a.hs new file mode 100644 index 0000000000..ec6211e2fb --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513a.hs @@ -0,0 +1,6 @@ +module T22513a where + +a = 10 + +f :: a -> a +f = id
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513a.stderr b/testsuite/tests/rename/should_compile/T22513a.stderr new file mode 100644 index 0000000000..09a3471e2d --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513a.stderr @@ -0,0 +1,6 @@ +T22513a.hs:5:6: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘a’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘a’ defined at T22513a.hs:3:1 + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513b.hs b/testsuite/tests/rename/should_compile/T22513b.hs new file mode 100644 index 0000000000..d80dab4a32 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513b.hs @@ -0,0 +1,6 @@ +module T22513b where + +import Prelude (id, Int) + +f :: id -> Int +f _ = 10
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513b.stderr b/testsuite/tests/rename/should_compile/T22513b.stderr new file mode 100644 index 0000000000..0d710e8ab5 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513b.stderr @@ -0,0 +1,7 @@ +T22513b.hs:5:6: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘id’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘id’ imported from ‘Prelude’ at T22513b.hs:3:17-18 + (and originally defined in ‘GHC.Base’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable. diff --git a/testsuite/tests/rename/should_compile/T22513c.hs b/testsuite/tests/rename/should_compile/T22513c.hs new file mode 100644 index 0000000000..6f1cc8b547 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513c.hs @@ -0,0 +1,7 @@ +module T22513c where + +f :: Int -> Int +f a = g a + where + g :: a -> a + g = id
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513c.stderr b/testsuite/tests/rename/should_compile/T22513c.stderr new file mode 100644 index 0000000000..ee2bc58336 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513c.stderr @@ -0,0 +1,6 @@ +T22513c.hs:6:10: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘a’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘a’ defined at T22513c.hs:4:3 + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable. diff --git a/testsuite/tests/rename/should_compile/T22513d.hs b/testsuite/tests/rename/should_compile/T22513d.hs new file mode 100644 index 0000000000..7082c90688 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513d.hs @@ -0,0 +1,3 @@ +module T22513d where + +f (Just (x :: id) :: Maybe id) = x
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513d.stderr b/testsuite/tests/rename/should_compile/T22513d.stderr new file mode 100644 index 0000000000..dedf7a5002 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513d.stderr @@ -0,0 +1,7 @@ +T22513d.hs:3:28: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘id’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘id’ imported from ‘Prelude’ at T22513d.hs:1:8-14 + (and originally defined in ‘GHC.Base’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513e.hs b/testsuite/tests/rename/should_compile/T22513e.hs new file mode 100644 index 0000000000..63e661bd76 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513e.hs @@ -0,0 +1,3 @@ +module T22513e where + +data T (a :: id) = MkT
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513e.stderr b/testsuite/tests/rename/should_compile/T22513e.stderr new file mode 100644 index 0000000000..2598537d1d --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513e.stderr @@ -0,0 +1,7 @@ +T22513e.hs:3:14: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘id’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘id’ imported from ‘Prelude’ at T22513e.hs:1:8-14 + (and originally defined in ‘GHC.Base’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513f.hs b/testsuite/tests/rename/should_compile/T22513f.hs new file mode 100644 index 0000000000..0ef422fdeb --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513f.hs @@ -0,0 +1,6 @@ +module T22513f where + +import Data.Proxy + +p :: () -> forall (a :: id). Proxy a +p () = Proxy
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513f.stderr b/testsuite/tests/rename/should_compile/T22513f.stderr new file mode 100644 index 0000000000..e6045be3a3 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513f.stderr @@ -0,0 +1,7 @@ +T22513f.hs:5:25: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘id’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘id’ imported from ‘Prelude’ at T22513f.hs:1:8-14 + (and originally defined in ‘GHC.Base’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513g.hs b/testsuite/tests/rename/should_compile/T22513g.hs new file mode 100644 index 0000000000..1895b70bc2 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513g.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE ScopedTypeVariables #-} +module T22513g where +import Data.Kind + +data T k (id::head) (b::k) :: k2 -> head -> Type
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513g.stderr b/testsuite/tests/rename/should_compile/T22513g.stderr new file mode 100644 index 0000000000..636a35bfaa --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513g.stderr @@ -0,0 +1,7 @@ +T22513g.hs:5:15: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘head’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘head’ imported from ‘Prelude’ at T22513g.hs:2:8-14 + (and originally defined in ‘GHC.List’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513h.hs b/testsuite/tests/rename/should_compile/T22513h.hs new file mode 100644 index 0000000000..a29ced5a44 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513h.hs @@ -0,0 +1,8 @@ +module T22513h where + +class C a where + f :: a -> Bool + +instance C (Maybe id) where + f (Just _) = True + f Nothing = False
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513h.stderr b/testsuite/tests/rename/should_compile/T22513h.stderr new file mode 100644 index 0000000000..33244dd11d --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513h.stderr @@ -0,0 +1,7 @@ +T22513h.hs:6:19: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘id’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘id’ imported from ‘Prelude’ at T22513h.hs:1:8-14 + (and originally defined in ‘GHC.Base’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513i.hs b/testsuite/tests/rename/should_compile/T22513i.hs new file mode 100644 index 0000000000..45e217489f --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513i.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} + +module T22513i where + +import Language.Haskell.TH + +sp :: Q () +sp = + $(do + instances <- reifyInstances ''Show [ VarT (mkName "id") ] + [e| return () |])
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/T22513i.stderr b/testsuite/tests/rename/should_compile/T22513i.stderr new file mode 100644 index 0000000000..d99b621a47 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T22513i.stderr @@ -0,0 +1,7 @@ +T22513i.hs:9:6: warning: [GHC-54201] [-Wterm-variable-capture] + The type variable ‘id’ is implicitly quantified, + even though another variable of the same name is in scope: + ‘id’ imported from ‘Prelude’ at T22513i.hs:3:8-14 + (and originally defined in ‘GHC.Base’) + This is not forward-compatible with a planned GHC extension, RequiredTypeArguments. + Suggested fix: Consider renaming the type variable.
\ No newline at end of file diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T index 9ad3dd0baf..2477d55daa 100644 --- a/testsuite/tests/rename/should_compile/all.T +++ b/testsuite/tests/rename/should_compile/all.T @@ -190,3 +190,12 @@ test('T19984', normal, compile, ['-fwarn-unticked-promoted-constructors']) test('T21654', normal, compile, ['-Wunused-top-binds']) test('T22057', normal, compile, ['-Wall']) test('T22067', req_th, compile, ['-Wall']) +test('T22513a', normal, compile, ['-Wterm-variable-capture']) +test('T22513b', normal, compile, ['-Wterm-variable-capture']) +test('T22513c', normal, compile, ['-Wterm-variable-capture']) +test('T22513d', normal, compile, ['-Wterm-variable-capture']) +test('T22513e', normal, compile, ['-Wterm-variable-capture']) +test('T22513f', normal, compile, ['-Wterm-variable-capture']) +test('T22513g', normal, compile, ['-Wterm-variable-capture']) +test('T22513h', normal, compile, ['-Wterm-variable-capture']) +test('T22513i', normal, compile, ['-Wterm-variable-capture'])
\ No newline at end of file |