[GHC] #10815: Need more kind inference in associated type instances
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- When I say {{{ {-# LANGUAGE DataKinds, PolyKinds, TypeFamilies #-} module Bug where import Data.Proxy class kproxy ~ 'KProxy => C (kproxy :: KProxy k) where type F (a :: k) instance C ('KProxy :: KProxy Bool) where type F a = Int }}} I get {{{ Type indexes must match class instance head Found ‘k’ but expected ‘Bool’ In the type instance declaration for ‘F’ In the instance declaration for ‘C (KProxy :: KProxy Bool)’ }}} But the kind of `a` should really be known to be `Bool`. This ticket is broken out from comment:3:ticket:9063, which was evidently not addressed when fixing that ticket. Patch coming soon. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1195 -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => patch * differential: => Phab:D1195 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1195 -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"2d4db40ac07db2fc776d61aac2383608911281ff/ghc" 2d4db40a/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2d4db40ac07db2fc776d61aac2383608911281ff" Fix #10815 by kind-checking type patterns against known kinds. tcFamTyPats now must take information about the instantiation of any class variables, when checking the instance of an associated type. Getting this to work out required some unexpected refactoring in TcDeriv. TcDeriv needs to look at class instances because of the possibility of associated datatypes with `deriving` specs. TcDeriv worked over the user-specified instances. But any data family instances were already processed, and TcDeriv had no way of finding the rep tycons. Indeed, TcDeriv *re-type-checked* any data family instances in an attempt to rediscover what GHC already knew. So, this commit introduces better tracking of compiled data families between TcInstDcls and TcDeriv to streamline all of this. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.10.3 Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_compile/T10815 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1195 -------------------------------------+------------------------------------- Changes (by goldfire): * status: patch => merge * testcase: => indexed-types/should_compile/T10815 * milestone: => 7.10.3 Comment: Merge only if convenient. I doubt this is biting anyone other than me, and I can wait until 8.0 for this. But it is a real bug. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_compile/T10815 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1195 -------------------------------------+------------------------------------- Changes (by bgamari): * owner: goldfire => * status: merge => new Comment: It doesn't look like this will be terribly convenient. Punting. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_compile/T10815 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1195 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10815: Need more kind inference in associated type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_compile/T10815 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1195 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 7.10.3 => 8.0.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10815#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC