diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/module/mod132.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/module/mod147.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr | 8 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T18740a.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T18740a.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T18740b.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T18740b.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/th/T14627.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/th/T18740c.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/th/T18740c.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/T18740d.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/th/T18740d.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 2 |
14 files changed, 86 insertions, 6 deletions
diff --git a/testsuite/tests/module/mod132.stderr b/testsuite/tests/module/mod132.stderr index 647a405bf9..37c934c70f 100644 --- a/testsuite/tests/module/mod132.stderr +++ b/testsuite/tests/module/mod132.stderr @@ -1,4 +1,7 @@ mod132.hs:6:7: error: - • Data constructor not in scope: Foo - • Perhaps you meant variable ‘foo’ (line 6) + Illegal term-level use of the type constructor ‘Foo’ + imported from ‘Mod132_B’ at mod132.hs:4:1-15 + (and originally defined in ‘Mod132_A’ at Mod132_A.hs:3:1-14) + In the expression: Foo + In an equation for ‘foo’: foo = Foo diff --git a/testsuite/tests/module/mod147.stderr b/testsuite/tests/module/mod147.stderr index 0a4e3fd662..80267f8f24 100644 --- a/testsuite/tests/module/mod147.stderr +++ b/testsuite/tests/module/mod147.stderr @@ -1,2 +1,7 @@ -mod147.hs:6:5: error: Data constructor not in scope: D :: t0 -> t +mod147.hs:6:5: + Illegal term-level use of the type constructor ‘D’ + imported from ‘Mod147_A’ at mod147.hs:4:1-15 + (and originally defined at Mod147_A.hs:3:1-14) + In the expression: D 4 + In an equation for ‘x’: x = D 4 diff --git a/testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr b/testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr index ad574a619f..8beac36a43 100644 --- a/testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr +++ b/testsuite/tests/rename/should_fail/RnStaticPointersFail02.stderr @@ -1,3 +1,7 @@ -RnStaticPointersFail02.hs:5:12: error: - Data constructor not in scope: T +RnStaticPointersFail02.hs:5:12: +Illegal term-level use of the type constructor ‘T’ + defined at RnStaticPointersFail02.hs:7:1 +In the body of a static form: T + In the expression: static T + In an equation for ‘f’: f = static T diff --git a/testsuite/tests/rename/should_fail/T18740a.hs b/testsuite/tests/rename/should_fail/T18740a.hs new file mode 100644 index 0000000000..b827dbeac8 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T18740a.hs @@ -0,0 +1,3 @@ +module T18740a where + +x = Int diff --git a/testsuite/tests/rename/should_fail/T18740a.stderr b/testsuite/tests/rename/should_fail/T18740a.stderr new file mode 100644 index 0000000000..2a0463adf0 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T18740a.stderr @@ -0,0 +1,7 @@ + +T18740a.hs:3:5: error: + • Illegal term-level use of the type constructor ‘Int’ + imported from ‘Prelude’ at T18740a.hs:1:8-14 + (and originally defined in ‘GHC.Types’) + • In the expression: Int + In an equation for ‘x’: x = Int diff --git a/testsuite/tests/rename/should_fail/T18740b.hs b/testsuite/tests/rename/should_fail/T18740b.hs new file mode 100644 index 0000000000..e2961093a9 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T18740b.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE ScopedTypeVariables #-} +module T18740b where + +import Data.Proxy + +f (Proxy :: Proxy a) = a diff --git a/testsuite/tests/rename/should_fail/T18740b.stderr b/testsuite/tests/rename/should_fail/T18740b.stderr new file mode 100644 index 0000000000..86c6c74961 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T18740b.stderr @@ -0,0 +1,6 @@ + +T18740b.hs:6:24: error: + • Illegal term-level use of the type variable ‘a’ + bound at T18740b.hs:6:4 + • In the expression: a + In an equation for ‘f’: f (Proxy :: Proxy a) = a diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 2647ac706b..e380a913ad 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -156,3 +156,5 @@ test('T17593', normal, compile_fail, ['']) test('T18145', normal, compile_fail, ['']) test('T18240a', normal, compile_fail, ['']) test('T18240b', normal, compile_fail, ['']) +test('T18740a', normal, compile_fail, ['']) +test('T18740b', normal, compile_fail, ['']) diff --git a/testsuite/tests/th/T14627.stderr b/testsuite/tests/th/T14627.stderr index 1db648811b..e9e8486256 100644 --- a/testsuite/tests/th/T14627.stderr +++ b/testsuite/tests/th/T14627.stderr @@ -1,2 +1,7 @@ -T14627.hs:4:1: error: Data constructor not in scope: Bool +T14627.hs:4:1: +Illegal term-level use of the type constructor ‘Bool’ + imported from ‘Prelude’ at T14627.hs:1:1 + (and originally defined in ‘GHC.Types’) +In the expression: Bool + In an equation for ‘f’: f = Bool diff --git a/testsuite/tests/th/T18740c.hs b/testsuite/tests/th/T18740c.hs new file mode 100644 index 0000000000..825e6faaf0 --- /dev/null +++ b/testsuite/tests/th/T18740c.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module T18740c where + +import Data.Proxy +import Language.Haskell.TH.Syntax + +[d| f (Proxy :: Proxy a) = a |] >>= addTopDecls >> return [] diff --git a/testsuite/tests/th/T18740c.stderr b/testsuite/tests/th/T18740c.stderr new file mode 100644 index 0000000000..dd718cbf33 --- /dev/null +++ b/testsuite/tests/th/T18740c.stderr @@ -0,0 +1,6 @@ + +T18740c.hs:9:1: error: + • Illegal term-level use of the type variable ‘a’ + bound at T18740c.hs:9:1 + • In the expression: a + In an equation for ‘f’: f (Proxy :: Proxy a) = a diff --git a/testsuite/tests/th/T18740d.hs b/testsuite/tests/th/T18740d.hs new file mode 100644 index 0000000000..e828a273e6 --- /dev/null +++ b/testsuite/tests/th/T18740d.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T18740d where + +import Language.Haskell.TH + +-- If we used 'ConE' here, then we would expect this error message: +-- +-- Illegal term-level use of the type constructor ‘Bool’ +-- imported from ‘Prelude’ at T18740d.hs:3:8-14 +-- (and originally defined in ‘GHC.Types’) +-- +-- But we used 'VarE', so the error message should say: +-- +-- Illegal variable name: ‘Bool’ +-- +e1 = $(return (VarE ''Bool)) diff --git a/testsuite/tests/th/T18740d.stderr b/testsuite/tests/th/T18740d.stderr new file mode 100644 index 0000000000..65c9607e88 --- /dev/null +++ b/testsuite/tests/th/T18740d.stderr @@ -0,0 +1,5 @@ + +T18740d.hs:17:7: error: + • Illegal variable name: ‘Bool’ + When splicing a TH expression: GHC.Types.Bool + • In the untyped splice: $(return (VarE ''Bool)) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 6dae863564..7e4f389b84 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -515,3 +515,5 @@ test('T18121', normal, compile, ['']) test('T18123', normal, compile, ['']) test('T18388', normal, compile, ['']) test('T18612', normal, compile, ['']) +test('T18740c', normal, compile_fail, ['']) +test('T18740d', normal, compile_fail, ['']) |