[GHC] #15138: Unable to instantiate data members of kind Nat in backpack signatures.

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This is in context with backpack signatures and their instantiation with concrete implementation. Consider the signature `Abstract` which contains a data `NatType` of kind `Nat`. {{{#!hs {- skipped relevant language extensions -} signature Abstract where import GHC.TypeLits data NatType :: Nat -- comment this out }}} Concrete implementations are unable to instantiate this abstract class during linking {{{#!hs module Concrete where type NatType = 42 }}} This is neither working with explicit .bkp files nor actual cabal package. I have isolated a minimum example into a repository [[https://github.com /piyush-kurur/backpack-nat| a cabal packages]] as well as a [[https://github.com/piyush-kurur/backpack-nat/blob/master/as-bkpfiles /backpack-nat.bkp|single bkp file]]. The urls above also have the associated ghc log messages. The version of ghc I have tested with is 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D4951 * milestone: 8.8.1 => 8.6.1 Comment: This looks simple enough that I think we can sneak it in to 8.6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * keywords: => backpack -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.6.1 => 8.8.1 Comment: Unfortunately it doesn't look like this will quite make it. Sorry ppk! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Comment (by ppk): Replying to [comment:4 bgamari]:
Unfortunately it doesn't look like this will quite make it. Sorry ppk!
That is okey. Thanks for all the effort you and the ghc team makes. But here are some of the things about the failing test cases. I am documenting it here so that it can be useful for diagnosing them if this patch has to eventually land. 1. The failing tests are all in the backpack tests should_fail section namely bkpfail23,25,26,27 and 46 2. Of these all except `bkpfail46` is still giving compilation error which but the stderr are not matching. As a result the most interesting test is `bkpfail46` as that is a case that was rejected before the patch which is getting accepted now. So we should really understand bkpfail46 to make sense whether it is i. Making backpack more general (a good thing). This just means that the test case is no more relevant and could just be removed or ignored. ii. Or this could be a break in typesafety and hence bad. I do not think I understand the issues there fully to make a comment on it one way or the other. 3. The next critical test is the bkpfail25 as it gives an error message of the form {{{ bkpfail25.bkp:7:18: error: _ The type synonym _T_ should have 1 argument, but has been given none _ In the instance declaration for _Functor T_ }}} There is a comment `bkpfail25.bkp` that precisely says that such an error message is "too late". So this too looks like a test case that needs some analysis. 4. The other tests that fails, I do not have much to say. I wanted to say that I also have a dependent phab which builds on this to fix #15379 where I did document this. These tests were failing on my machine and I was thinking that it could be some change that I introduced in that patch which made the difference. Now it looks like this is a problem even here. In summary, this looks like a test that requires some serious thought from someone who understands the backpack system much more than me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Comment (by ppk): I think the issue was a wild card pattern match gone wrong. The sharp eyes of @bgamari spotted it. The changes have been pushed to Phab. I think this patch is ready to land -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Comment (by ppk): @bgamari now that the patch is not failing the tests can you schedule this for ghc-8.6 instead of ghc-8.8. Please also consider #15379 if that is the case as without it, this patch alone will not be as useful. We had this discussion on IRC but I am putting it here for documentation. Thanks for spotting that bug in any case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.8.1 => 8.6.1 Comment: Absolutely. Thanks ppk! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures. -------------------------------------+------------------------------------- Reporter: ppk | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.1 Resolution: fixed | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4951 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: 8.6.1 => 8.8.1 Comment: I just looked at the patch for #15379 and I'm afraid it's a bit large for 8.6. Retargetting this for 8.6. Sorry ppk! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15138#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15138: Unable to instantiate data members of kind Nat in backpack signatures.
-------------------------------------+-------------------------------------
Reporter: ppk | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.4.1
Resolution: fixed | Keywords: backpack
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4951
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC