[GHC] #8262: Ill-kinded value is not rejected immediately
#8262: Ill-kinded value is not rejected immediately -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 7.7 checker) | Operating System: Unknown/Multiple Keywords: | Type of failure: GHC accepts Architecture: Unknown/Multiple | invalid program Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- The expression `Just (1#)` is ill-kinded, since `Just` expects a parameter of type `a :: *` not `#`. GHC 7.6.3 recognizes this {{{ λ> :t Just (1#) <interactive>:1:7: Couldn't match kind `*' against `#' Kind incompatibility when matching types: a0 :: * GHC.Prim.Int# :: # In the first argument of `Just', namely `(1#)' In the expression: Just (1#) }}} while HEAD gives {{{ λ> :t Just (1#) Just (1#) :: a ~ GHC.Prim.Int# => Maybe a }}} Not a big deal, attempting to do anything with this value gives the same error as in 7.6.3. But still, I think it should be rejected as ill-kinded at sight. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8262 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
#8262: Ill-kinded value is not rejected immediately ------------------------------------------------+-------------------------- Reporter: monoidal | Owner: Type: bug | simonpj Priority: low | Status: new Component: Compiler (Type checker) | Milestone: Resolution: | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: GHC accepts invalid program | Architecture: Test Case: | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Changes (by simonpj): * owner: => simonpj Comment: Excellent example. I'll fix this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8262#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
#8262: Ill-kinded value is not rejected immediately
------------------------------------------------+--------------------------
Reporter: monoidal | Owner:
Type: bug | simonpj
Priority: low | Status: new
Component: Compiler (Type checker) | Milestone:
Resolution: | Version: 7.7
Operating System: Unknown/Multiple | Keywords:
Type of failure: GHC accepts invalid program | Architecture:
Test Case: | Unknown/Multiple
Blocking: | Difficulty:
| Unknown
| Blocked By:
| Related Tickets:
------------------------------------------------+--------------------------
Comment (by Simon Peyton Jones
#8262: Ill-kinded value is not rejected immediately
------------------------------------------------+--------------------------
Reporter: monoidal | Owner:
Type: bug | simonpj
Priority: low | Status: new
Component: Compiler (Type checker) | Milestone:
Resolution: | Version: 7.7
Operating System: Unknown/Multiple | Keywords:
Type of failure: GHC accepts invalid program | Architecture:
Test Case: | Unknown/Multiple
Blocking: | Difficulty:
| Unknown
| Blocked By:
| Related Tickets:
------------------------------------------------+--------------------------
Comment (by Simon Peyton Jones
#8262: Ill-kinded value is not rejected immediately ------------------------------------------------+-------------------------- Reporter: monoidal | Owner: Type: bug | simonpj Priority: low | Status: closed Component: Compiler (Type checker) | Milestone: Resolution: fixed | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: GHC accepts invalid program | Architecture: Test Case: typecheck/should_fail/T8262 | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Changes (by simonpj): * status: new => closed * testcase: => typecheck/should_fail/T8262 * resolution: => fixed Comment: Great bug report thank you. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8262#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
#8262: Ill-kinded value is not rejected immediately
------------------------------------------------+--------------------------
Reporter: monoidal | Owner:
Type: bug | simonpj
Priority: low | Status: closed
Component: Compiler (Type checker) | Milestone:
Resolution: fixed | Version: 7.7
Operating System: Unknown/Multiple | Keywords:
Type of failure: GHC accepts invalid program | Architecture:
Test Case: typecheck/should_fail/T8262 | Unknown/Multiple
Blocking: | Difficulty:
| Unknown
| Blocked By:
| Related Tickets:
------------------------------------------------+--------------------------
Comment (by nomeata):
It seems that the test does not reflect the latest state of the error
message:
{{{
=====> T8262(normal) 1047 of 3757 [0, 0, 0]
cd ./typecheck/should_fail && '/home/jojo/build/haskell/ghc/inplace/bin
/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-
user-package-db -rtsopts -fno-ghci-history -c T8262.hs
>T8262.comp.stderr 2>&1
Actual stderr output differs from expected:
--- ./typecheck/should_fail/T8262.stderr 2013-09-10
20:00:51.900811113 +0200
+++ ./typecheck/should_fail/T8262.comp.stderr 2013-09-10
22:56:47.636429053 +0200
@@ -1,12 +1,10 @@
-ghc-stage1: panic! (the 'impossible' happened)
- (GHC version 7.7.20130829 for x86_64-unknown-linux):
- ASSERT failed!
- file compiler/coreSyn/MkCore.lhs line 303
- Sym cobox{v dfK} [lid]
- ghc-prim:GHC.Prim.Int#{(w) tc 3G}
- a{tv afq} [tv]
- ghc-prim:GHC.Prim.#{(w) tc 34j}
- ghc-prim:GHC.Prim.*{(w) tc 34d}
-
-Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
+T8262.hs:5:15:
+ Kind incompatibility when matching types:
+ a :: *
+ GHC.Prim.Int# :: #
+ Relevant bindings include
+ foo :: t -> Maybe a (bound at T8262.hs:5:1)
+ In the first argument of ‛Just’, namely ‛(1#)’
+ In the expression: Just (1#)
+ In an equation for ‛foo’: foo x = Just (1#)
*** unexpected failure for T8262(normal)
}}}
Also, the fix for #8233 seems to require a
{{{
make -C testsuite accept "TEST=Overlap11"
}}}
--
Ticket URL:
GHC
The Glasgow Haskell Compiler
#8262: Ill-kinded value is not rejected immediately ------------------------------------------------+-------------------------- Reporter: monoidal | Owner: Type: bug | simonpj Priority: low | Status: closed Component: Compiler (Type checker) | Milestone: Resolution: fixed | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: GHC accepts invalid program | Architecture: Test Case: typecheck/should_fail/T8262 | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by simonpj): Apologies, fixed. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8262#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
#8262: Ill-kinded value is not rejected immediately ------------------------------------------------+-------------------------- Reporter: monoidal | Owner: Type: bug | simonpj Priority: low | Status: closed Component: Compiler (Type checker) | Milestone: Resolution: fixed | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: GHC accepts invalid program | Architecture: Test Case: typecheck/should_fail/T8262 | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by monoidal): Unfortunately the change causes #8129 and possibly also #8314. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8262#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC