GHC panic when used with deferred type errors
Attached code panics when run with -fdefer-type-errors
.
Edit: Code should not type check but it should not cause a panic either :)
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related or that one is blocking others. Learn more.
Activity
- Icelandjack changed weight to 5
changed weight to 5
- Icelandjack added Tbug Trac import typechecker labels
added Tbug Trac import typechecker labels
- Author Reporter
Attached file
error.hs
($1047). - Author Reporter
Attached file
err.log
(download).Error message when loading Error.hs with GHCi, -fdefer-type-errors.
- Icelandjack changed the description
changed the description
- Author Reporter
- Developer
Works fine in HEAD. Can someone try the 7.8.4 branch?
Here are the HEAD error messages. I have not looked at them, but there is no crash.
T9834.hs:24:10: Warning: Couldn't match type ‘p’ with ‘(->) (p a0)’ ‘p’ is a rigid type variable bound by the class declaration for ‘ApplicativeFix’ at T9834.hs:22:39 Expected type: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a Actual type: (forall (q :: * -> *). Applicative q => Nat (Comp p q) (Comp p q)) -> p a0 -> p a0 Relevant bindings include afix :: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a (bound at T9834.hs:24:3) In the expression: wrapIdComp In an equation for ‘afix’: afix = wrapIdComp T9834.hs:24:10: Warning: Couldn't match type ‘a’ with ‘p a0’ ‘a’ is a rigid type variable bound by the type signature for afix :: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a at T9834.hs:23:11 Expected type: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a Actual type: (forall (q :: * -> *). Applicative q => Nat (Comp p q) (Comp p q)) -> p a0 -> p a0 Relevant bindings include afix :: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a (bound at T9834.hs:24:3) In the expression: wrapIdComp In an equation for ‘afix’: afix = wrapIdComp T9834.hs:24:10: Warning: Couldn't match type ‘a’ with ‘a1’ ‘a’ is a rigid type variable bound by the type signature for afix :: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a at T9834.hs:23:11 ‘a1’ is a rigid type variable bound by a type expected by the context: Applicative q => Comp p q a1 -> Comp p q a1 at T9834.hs:24:10 Expected type: Comp p q a1 -> Comp p q a1 Actual type: Comp p q a -> Comp p q a Relevant bindings include afix :: (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a) -> p a (bound at T9834.hs:24:3) In the expression: wrapIdComp In an equation for ‘afix’: afix = wrapIdComp
I just checked and I'm getting a panic on my branch forked from HEAD 5 days ago. So if the fix indeed went into HEAD it must be really recent. I tried cherry-picking 2cc854b7 onto my branch because it does typed-holes-related stuff but that doesn't fix the panic.
I also confirmed that this happens with GHC 7.8.4:
Aside: To get the reported test case compiling with HEAD I had to change
import Control.Monad.Identity
toimport Data.Functor.Identity
.- Simon Peyton Jones mentioned in commit cb9bcecc
mentioned in commit cb9bcecc
- Developer
OK well maybe it is recent, but at least it works now. I've added the module as a regression test.
Trac metadata
Trac field Value Test case → typecheck/should_compile/T9834 - Simon Peyton Jones closed
closed
- Developer
I'll close this, because I think it unlikely we'll ever do 7.8.5 and we don't know what to merge across even if we did.
Trac metadata
Trac field Value Resolution Unresolved → ResolvedFixed - Icelandjack mentioned in issue #10248 (closed)
mentioned in issue #10248 (closed)
- trac-import added GHCi label
added GHCi label
- Ben Gamari added Pnormal label
added Pnormal label