[GHC] #15899: Testcase tcfail158 is broken

#15899: Testcase tcfail158 is broken -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Test Suite | Version: 8.7 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Other Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Test testsuite/tests/typecheck/should_fail/tcfail158.hs contains the following code: {{{#!hs {-# LANGUAGE ExplicitForAll #-} -- This one actually crashed in 6.4.1 -- There's a kind error in the signature for bar, -- and we were recovering, and then crashing when we found -- a scoped type variable not in scope data Val v sm = Val foo :: forall v sm. Val v sm foo = undefined where foo1 :: Val v sm foo1 = bar -- Correct type signature: bar :: forall v sm. Val v sm bar :: forall v. Val v bar = undefined foo }}} The expected test result in testsuite/tests/typecheck/should_fail/tcfail158.stderr is: {{{ tcfail158.hs:1:1: error: The IO action ‘main’ is not defined in module ‘Main’ }}} == Issues: 1. With a very high probability, the intention of this test was not to test on the missing main function. The intention was to test the error message for the type signature of function ''bar'' . 2. The code for the definitions and functions start in column 2 and not in column 1. 3. With an added main function GHC Versions 8.0, 8.2, 8.4 and 8.6 report the following error: {{{ tcfail158.hs:17:18: error: • Expecting one more argument to ‘Val v’ Expected a type, but ‘Val v’ has kind ‘* -> *’ • In the type signature: bar :: forall v. Val v }}} 4. GHC HEAD version 8.7.20181112, however, reports: {{{ tcfail158.hs:15:17: error: • Couldn't match expected type ‘Val v1 sm1’ with actual type ‘Val v0’ • In the expression: bar In an equation for ‘foo1’: foo1 = bar In an equation for ‘foo’: foo = undefined where foo1 :: Val v sm foo1 = bar • Relevant bindings include foo1 :: Val v1 sm1 (bound at tcfail158.hs:15:10) tcfail158.hs:17:18: error: • Expecting one more argument to ‘Val v’ Expected a type, but ‘Val v’ has kind ‘* -> *’ • In the type signature: bar :: forall v. Val v ^^^^^ tcfail158.hs:18:7: error: • Couldn't match kind ‘* -> *’ with ‘*’ When matching types t0 :: * Val v :: * -> * • In the expression: undefined foo In an equation for ‘bar’: bar = undefined foo • Relevant bindings include bar :: Val v (bound at tcfail158.hs:18:1) }}} GHC HEAD reports errors in 3 different lines 15, 17 and 18. Fix the type signature in line 17 and GHC compiles successfully. The error messages produced by GHC HEAD are very confusing! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15899 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15899: Testcase tcfail158 is broken -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Test Suite | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12906 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #12906 Comment: It's worth noting that `tcfail158` will in fact start reporting these errors once/if the fix for #12906 (Phab:D5338) lands. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15899#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15899: Testcase tcfail158 is broken -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Test Suite | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12906 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RolandSenn): Phab:D5338 skips test {{{tcfail158}}}. Hence CI should not be affected. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15899#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15899: Testcase tcfail158 is broken -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Test Suite | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12906 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Here is a somewhat simplified version of the issue: {{{#!hs module Bug where f, g :: Maybe f = Nothing g = undefined }}} In GHC 8.6.2, this simply errors with: {{{ $ ~/Software/haskell/ghc-8.6.2/bin/ghc Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) Bug.hs:3:9: error: • Expecting one more argument to ‘Maybe’ Expected a type, but ‘Maybe’ has kind ‘* -> *’ • In the type signature: f :: Maybe | 3 | f, g :: Maybe | ^^^^^ }}} But in GHC HEAD (as of commit df570d920fa66db631f936fa377e598fe92bd2a1), we get many more errors: {{{ $ ghc/inplace/bin/ghc-stage2 Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) Bug.hs:3:9: error: • Expecting one more argument to ‘Maybe’ Expected a type, but ‘Maybe’ has kind ‘* -> *’ • In the type signature: f :: Maybe | 3 | f, g :: Maybe | ^^^^^ Bug.hs:4:5: error: • Couldn't match expected type ‘Maybe’ with actual type ‘Maybe a1’ • In the expression: Nothing In an equation for ‘f’: f = Nothing | 4 | f = Nothing | ^^^^^^^ Bug.hs:5:5: error: • Couldn't match kind ‘* -> *’ with ‘*’ When matching types a0 :: * Maybe :: * -> * • In the expression: undefined In an equation for ‘g’: g = undefined | 5 | g = undefined | ^^^^^^^^^ }}} I'll try tracking down which commit introduced this regression when I get a chance. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15899#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15899: Testcase tcfail158 is broken -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Test Suite | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12906 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: goldfire (added) Comment: This regression was introduced in commit c955a514f033a12f6d0ab0fbacec3e18a5757ab5 (`Remove decideKindGeneralisationPlan`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15899#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15899: Testcase tcfail158 is broken -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Test Suite | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #12906 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * cc: monoidal (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15899#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC