From ba46e63f3d6f7d0438a0262f6711f8a219c703bc Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Tue, 11 Jul 2017 13:59:07 -0400 Subject: Fix #13948 by being pickier about when to suggest DataKinds Commit 343cb32d0983f576d344a2d04a35c3fd6eecf2c5 (#13568) made GHC a bit too cavalier in suggesting when data constructors are in scope (and suggesting the use of `DataKinds`). This tones down the suggestions so that `DataKinds` is only suggested if a data constructor of that name is actually in scope (previously, it would always suggest, even if it was out of scope). Fixes #13948. Test Plan: ./validate Reviewers: mpickering, austin, bgamari Reviewed By: mpickering Subscribers: rwbarton, thomie GHC Trac Issues: #13948 Differential Revision: https://phabricator.haskell.org/D3719 --- testsuite/tests/module/mod122.stderr | 4 +--- testsuite/tests/module/mod123.stderr | 4 +--- testsuite/tests/module/mod124.stderr | 1 - testsuite/tests/module/mod127.stderr | 1 - testsuite/tests/module/mod29.stderr | 1 - testsuite/tests/module/mod50.stderr | 4 +--- testsuite/tests/parser/should_fail/readFail001.stderr | 1 - testsuite/tests/rename/prog003/rename.prog003.stderr | 4 +--- testsuite/tests/rename/should_fail/T1595a.stderr | 1 - testsuite/tests/rename/should_fail/T5745.stderr | 4 +--- testsuite/tests/typecheck/should_fail/T1595.stderr | 2 -- testsuite/tests/typecheck/should_fail/tcfail048.stderr | 1 - testsuite/tests/typecheck/should_fail/tcfail053.stderr | 1 - 13 files changed, 5 insertions(+), 24 deletions(-) (limited to 'testsuite/tests') diff --git a/testsuite/tests/module/mod122.stderr b/testsuite/tests/module/mod122.stderr index 66aaaf2304..51338f0a06 100644 --- a/testsuite/tests/module/mod122.stderr +++ b/testsuite/tests/module/mod122.stderr @@ -1,4 +1,2 @@ -mod122.hs:5:6: error: - Not in scope: type constructor or class ‘C’ - A data constructor of that name is in scope; did you mean DataKinds? +mod122.hs:5:6: error: Not in scope: type constructor or class ‘C’ diff --git a/testsuite/tests/module/mod123.stderr b/testsuite/tests/module/mod123.stderr index 38390d05d1..c31f6d5a39 100644 --- a/testsuite/tests/module/mod123.stderr +++ b/testsuite/tests/module/mod123.stderr @@ -1,4 +1,2 @@ -mod123.hs:5:6: error: - Not in scope: type constructor or class ‘T’ - A data constructor of that name is in scope; did you mean DataKinds? +mod123.hs:5:6: error: Not in scope: type constructor or class ‘T’ diff --git a/testsuite/tests/module/mod124.stderr b/testsuite/tests/module/mod124.stderr index cbf9f4558e..a052a506ad 100644 --- a/testsuite/tests/module/mod124.stderr +++ b/testsuite/tests/module/mod124.stderr @@ -1,6 +1,5 @@ mod124.hs:6:6: error: Not in scope: type constructor or class ‘T’ - A data constructor of that name is in scope; did you mean DataKinds? Perhaps you want to remove ‘T’ from the explicit hiding list in the import of ‘Mod124_A’ (mod124.hs:4:1-26). diff --git a/testsuite/tests/module/mod127.stderr b/testsuite/tests/module/mod127.stderr index 462ebbccaf..861d492d1a 100644 --- a/testsuite/tests/module/mod127.stderr +++ b/testsuite/tests/module/mod127.stderr @@ -1,6 +1,5 @@ mod127.hs:6:6: error: Not in scope: type constructor or class ‘T’ - A data constructor of that name is in scope; did you mean DataKinds? Perhaps you want to remove ‘T’ from the explicit hiding list in the import of ‘Mod127_A’ (mod127.hs:4:1-26). diff --git a/testsuite/tests/module/mod29.stderr b/testsuite/tests/module/mod29.stderr index 08a019e13d..e70c5df83d 100644 --- a/testsuite/tests/module/mod29.stderr +++ b/testsuite/tests/module/mod29.stderr @@ -1,6 +1,5 @@ mod29.hs:6:12: error: Not in scope: type constructor or class ‘Char’ - A data constructor of that name is in scope; did you mean DataKinds? Perhaps you want to add ‘Char’ to the import list in the import of ‘Prelude’ (mod29.hs:5:1-19). diff --git a/testsuite/tests/module/mod50.stderr b/testsuite/tests/module/mod50.stderr index 94878a8faa..9669427f8f 100644 --- a/testsuite/tests/module/mod50.stderr +++ b/testsuite/tests/module/mod50.stderr @@ -1,4 +1,2 @@ -mod50.hs:3:22: error: - Not in scope: type constructor or class ‘Foo’ - A data constructor of that name is in scope; did you mean DataKinds? +mod50.hs:3:22: error: Not in scope: type constructor or class ‘Foo’ diff --git a/testsuite/tests/parser/should_fail/readFail001.stderr b/testsuite/tests/parser/should_fail/readFail001.stderr index 3284c1b51c..6425d16c49 100644 --- a/testsuite/tests/parser/should_fail/readFail001.stderr +++ b/testsuite/tests/parser/should_fail/readFail001.stderr @@ -16,4 +16,3 @@ readFail001.hs:107:42: error: Not in scope: data constructor ‘Bar’ readFail001.hs:112:23: error: Not in scope: type constructor or class ‘Foo’ - A data constructor of that name is in scope; did you mean DataKinds? diff --git a/testsuite/tests/rename/prog003/rename.prog003.stderr b/testsuite/tests/rename/prog003/rename.prog003.stderr index 6babd0383b..b8f84781a6 100644 --- a/testsuite/tests/rename/prog003/rename.prog003.stderr +++ b/testsuite/tests/rename/prog003/rename.prog003.stderr @@ -1,4 +1,2 @@ -B.hs:4:6: error: - Not in scope: type constructor or class ‘Class’ - A data constructor of that name is in scope; did you mean DataKinds? +B.hs:4:6: error: Not in scope: type constructor or class ‘Class’ diff --git a/testsuite/tests/rename/should_fail/T1595a.stderr b/testsuite/tests/rename/should_fail/T1595a.stderr index 9b19421f3a..bcd601a377 100644 --- a/testsuite/tests/rename/should_fail/T1595a.stderr +++ b/testsuite/tests/rename/should_fail/T1595a.stderr @@ -1,4 +1,3 @@ T1595a.hs:3:20: error: Not in scope: type constructor or class ‘Tpyo’ - A data constructor of that name is in scope; did you mean DataKinds? diff --git a/testsuite/tests/rename/should_fail/T5745.stderr b/testsuite/tests/rename/should_fail/T5745.stderr index 94e3bd5217..dc590bba33 100644 --- a/testsuite/tests/rename/should_fail/T5745.stderr +++ b/testsuite/tests/rename/should_fail/T5745.stderr @@ -1,4 +1,2 @@ -T5745.hs:5:6: error: - Not in scope: type constructor or class ‘T’ - A data constructor of that name is in scope; did you mean DataKinds? +T5745.hs:5:6: error: Not in scope: type constructor or class ‘T’ diff --git a/testsuite/tests/typecheck/should_fail/T1595.stderr b/testsuite/tests/typecheck/should_fail/T1595.stderr index bed30c42cf..2f17fb8ffb 100644 --- a/testsuite/tests/typecheck/should_fail/T1595.stderr +++ b/testsuite/tests/typecheck/should_fail/T1595.stderr @@ -1,8 +1,6 @@ T1595.hs:8:15: error: Not in scope: type constructor or class ‘DoesNotExist’ - A data constructor of that name is in scope; did you mean DataKinds? T1595.hs:13:22: error: Not in scope: type constructor or class ‘DoesNotExist’ - A data constructor of that name is in scope; did you mean DataKinds? diff --git a/testsuite/tests/typecheck/should_fail/tcfail048.stderr b/testsuite/tests/typecheck/should_fail/tcfail048.stderr index 4c1c300ef8..49c8cf0360 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail048.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail048.stderr @@ -1,4 +1,3 @@ tcfail048.hs:3:8: error: Not in scope: type constructor or class ‘B’ - A data constructor of that name is in scope; did you mean DataKinds? diff --git a/testsuite/tests/typecheck/should_fail/tcfail053.stderr b/testsuite/tests/typecheck/should_fail/tcfail053.stderr index edd1537b14..75308e5fca 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail053.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail053.stderr @@ -1,4 +1,3 @@ tcfail053.hs:3:12: error: Not in scope: type constructor or class ‘A’ - A data constructor of that name is in scope; did you mean DataKinds? -- cgit v1.2.1