Ticket #3692 (closed bug: fixed)
Bogus type error message in type with constraints after the arrow
| Reported by: | cdfh | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.1 |
| Component: | Compiler | Version: | 6.12.1 |
| Keywords: | TcTyFuns PredType panic | Cc: | |
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | Compile-time crash | Difficulty: | |
| Test Case: | typecheck/should_compile/T3692 | Blocked By: | |
| Blocking: | Related Tickets: |
Description
Hello,
I've found a bug, however it may be a duplicate of one of these: #2846, #3272, #3592, #3125, #3102 (roughly in order of duplicate-likelihoodness).
Here's the code:
type Foo a b = () -> (Bar a => a)
class Bar a where {}
foo :: Foo a b
foo = id (undefined :: Foo a b)
And the result of compilation:
$ ghc -fglasgow-exts --make Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) ghc: panic! (the 'impossible' happened) (GHC version 6.10.4 for x86_64-unknown-linux): TcTyFuns.flattenType: unexpected PredType Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I'm running Gentoo Linux, with dev-lang/ghc-6.10.4 (not dev-haskell/haskell-platform)
Linux geneva 2.6.29-gentoo-r5 #1 SMP Sun Jul 12 03:16:58 BST 2009 x86_64 Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz GenuineIntel GNU/Linux
I'm afraid I've not tested this against HEAD, since I couldn't get it to build.
Note that foo = undefined :: Foo a b does not cause GHC to panic.
Change History
Note: See
TracTickets for help on using
tickets.
