diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-01-07 15:09:38 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-17 05:46:09 -0500 |
commit | fe344da9be83be4c7c0c7f76183acfe0a234cc5d (patch) | |
tree | 3ec30d9ca0fdf198da80d43dc0156007b9c3dbed /testsuite | |
parent | d930687a073f4209e6dd028363039a5869296d74 (diff) | |
download | haskell-fe344da9be83be4c7c0c7f76183acfe0a234cc5d.tar.gz |
Missing fields: enhance error messages (#18869)
This patch delays the detection of missing fields in record creation
after type-checking. This gives us better error messages (see updated
test outputs).
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/deSugar/should_compile/T13870.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T5892a.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T18869.stderr | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T13870.stderr b/testsuite/tests/deSugar/should_compile/T13870.stderr index 9f24693a65..3a5c8e199c 100644 --- a/testsuite/tests/deSugar/should_compile/T13870.stderr +++ b/testsuite/tests/deSugar/should_compile/T13870.stderr @@ -6,6 +6,6 @@ T13870.hs:8:9: warning: [-Wmissing-fields (in -Wdefault)] T13870.hs:14:9: warning: [-Wmissing-fields (in -Wdefault)] • Fields of ‘Identity’ not initialised: - runIdentity :: a + runIdentity :: Int • In the expression: Identity {} In an equation for ‘test3’: test3 = Identity {} diff --git a/testsuite/tests/rename/should_fail/T5892a.stderr b/testsuite/tests/rename/should_fail/T5892a.stderr index 23e9deb18b..436409ed24 100644 --- a/testsuite/tests/rename/should_fail/T5892a.stderr +++ b/testsuite/tests/rename/should_fail/T5892a.stderr @@ -1,7 +1,7 @@ T5892a.hs:12:8: error: [-Wmissing-fields (in -Wdefault), -Werror=missing-fields] • Fields of ‘Node’ not initialised: - subForest :: [Tree a] + subForest :: [Tree [Int]] • In the expression: Node {..} In the expression: let rootLabel = [] in Node {..} In an equation for ‘foo’: diff --git a/testsuite/tests/typecheck/should_fail/T18869.stderr b/testsuite/tests/typecheck/should_fail/T18869.stderr index 11c11f397e..12e8d6f0a3 100644 --- a/testsuite/tests/typecheck/should_fail/T18869.stderr +++ b/testsuite/tests/typecheck/should_fail/T18869.stderr @@ -1,24 +1,24 @@ T18869.hs:10:11: error: • Constructor ‘MkFoo’ does not have the required strict field(s): - foo :: a + foo :: a0 • In the expression: MkFoo {} In an equation for ‘testFoo’: testFoo = MkFoo {} T18869.hs:16:11: error: • Constructor ‘MkBar’ does not have the required strict field(s): - bar :: a + bar :: a0 • In the expression: MkBar {} In an equation for ‘testBar’: testBar = MkBar {} T18869.hs:22:11: error: • Constructor ‘MkBaz’ does not have the required strict field(s): - baz2 :: a + baz2 :: Bool • In the expression: MkBaz {baz1 = False} In an equation for ‘testBaz’: testBaz = MkBaz {baz1 = False} T18869.hs:30:12: error: • Constructor ‘MkQuux’ does not have the required strict field(s): - quux :: TQuux a + quux :: TQuux Int • In the expression: MkQuux {} In an equation for ‘testQuux’: testQuux = MkQuux {} |