[GHC] #12033: [TypeApplications] GHC internal error
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple TypeApplications | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Toying around, got {{{ GHCi, version 8.1.20160503: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( /tmp/CatFail.hs, interpreted ) /tmp/CatFail.hs:55:26: error: • GHC internal error: ‘a’ is not in scope during type checking, but it passed the renamer tcl_env of environment: [a1Ej :-> Type variable ‘i’ = i, a1Ek :-> Type variable ‘p’ = p, a1Et :-> Type variable ‘a’ = a, a1Eu :-> Type variable ‘b’ = b] • In the first argument of ‘Vacuous’, namely ‘a’ In the type ‘Vacuous a’ In the expression: Dict @(Vacuous a) /tmp/CatFail.hs:66:10: error: • Couldn't match type ‘Fun p q’ with ‘Vacuous’ arising from a use of ‘Main.$dmsrc’ • In the expression: Main.$dmsrc In an equation for ‘src’: src = Main.$dmsrc In the instance declaration for ‘Category (Nat p q)’ • Relevant bindings include src :: Nat p q a b -> Dict (Ob (Nat p q) a) (bound at /tmp/CatFail.hs:66:10) Failed, modules loaded: none. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Iceland_jack): * Attachment "CatFail.hs" added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by sjcjoosten): * Attachment "HaskellBug.hs" added. Small example with similar behavior -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sjcjoosten): I ran into this too, I'm not sure whether it is the same bug, but I managed to reproduce the same GHC internal error in a very small example. Based on what the two examples have in common, I would say this has something to do with the TypeFamilies switch (without it, ghc works as expected). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): `CatFail.hs` fails with {{{ T12033a.hs:45:31: error: Not in scope: type constructor or class ‘Dict’ }}} so perhaps the test isn't right. Anyway, I think #12055, which does reproduce, is a simpler test case. On the other hand `HaskellBug.hs` really is a new and quite different bug. Patch coming for that. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72/ghc" 15b9bf4b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72" Improve typechecking of let-bindings This major commit was initially triggered by #11339, but it spiraled into a major review of the way in which type signatures for bindings are handled, especially partial type signatures. On the way I fixed a number of other bugs, namely #12069 #12033 #11700 #11339 #11670 The main change is that I completely reorganised the way in which type signatures in bindings are handled. The new story is in TcSigs Note [Overview of type signatures]. Some specific: * Changes in the data types for signatures in TcRnTypes: TcIdSigInfo and new TcIdSigInst * New module TcSigs deals with typechecking type signatures and pragmas. It contains code mostly moved from TcBinds, which is already too big * HsTypes: I swapped the nesting of HsWildCardBndrs and HsImplicitBndsrs, so that the wildcards are on the oustide not the insidde in a LHsSigWcType. This is just a matter of convenient, nothing deep. There are a host of other changes as knock-on effects, and it all took FAR longer than I anticipated :-). But it is a significant improvement, I think. Lots of error messages changed slightly, some just variants but some modest improvements. New tests * typecheck/should_compile * SigTyVars: a scoped-tyvar test * ExPat, ExPatFail: existential pattern bindings * T12069 * T11700 * T11339 * partial-sigs/should_compile * T12033 * T11339a * T11670 One thing to check: * Small change to output from ghc-api/landmines. Need to check with Alan Zimmerman }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12033: [TypeApplications] GHC internal error -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: partial- | sigs/should_compile/T12033 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => partial-sigs/should_compile/T12033 * status: new => closed * resolution: => fixed Comment: With the above patch, `HaskellBug` problem is fixed. I've added it as a regression test. That leaves #12055, which we'll handle on that ticket, so I'm closing this one. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12033#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC