
#8503: New GeneralizedNewtypeDeriving check still isn't permissive enough -------------------------------------+------------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8541 -------------------------------------+------------------------------------ Comment (by nomeata): I cherry-picked Richard’s implementation of GND via coerce ([https://github.com/goldfirere/ghc/commit/c76fed9a9c6bffc5b0858d39589dabfe939... c76fed]) onto wip/T8503 and GHC compiles (after `make clean`) just fine – which is great. There are test suite failures, though A lot are performance degrations (some, if they are about the performance of GHC, are to be expected, the Coercible machinery with subsequent simplification is not the fastest code). The others are: {{{ Unexpected failures: codeGen/should_run cgrun068 [exit code non-0] (normal) deriving/should_compile T2856 [exit code non-0] (normal) deriving/should_compile drv015 [exit code non-0] (normal) deriving/should_fail T1496 [stderr mismatch] (normal) deriving/should_fail T2721 [stderr mismatch] (normal) deriving/should_fail T4846 [stderr mismatch] (normal) deriving/should_fail T7148 [stderr mismatch] (normal) deriving/should_fail T7148a [stderr mismatch] (normal) deriving/should_run drvrun019 [exit code non-0] (normal) gadt CasePrune [stderr mismatch] (normal) gadt gadt6 [exit code non-0] (normal) ghci.debugger/scripts print018 [bad stdout] (ghci) indexed-types/should_compile DerivingNewType [exit code non-0] (normal) indexed-types/should_compile IndTypesPerf [bad exit code] (normal) indexed-types/should_compile T2850 [exit code non-0] (normal) indexed-types/should_compile T3423 [exit code non-0] (normal) indexed-types/should_compile T4185 [exit code non-0] (normal) indexed-types/should_compile T5955 [bad exit code] (normal) indexed-types/should_compile T7474 [exit code non-0] (normal) lib/integer integerConstantFolding [bad stderr] (normal) polykinds T7332 [exit code non-0] (normal) roles/should_fail Roles10 [stderr mismatch] (normal) simplCore/should_compile T4203 [exit code non-0] (normal) typecheck/should_compile T3955 [exit code non-0] (normal) typecheck/should_fail T5246 [stderr mismatch] (normal) }}} Of these, there are a few where we get unresolved Coercible instances due to roles (and many of them might be genuine and can probably be marked as expected to fail), but there is also a number of panic and failed assertions. wip/T8503 itself validates, so these were either introduced or triggered by implementing GND via coerce. Probably triggered, given that the GND code now generates mostly straight-forward code. I’ll start looking into some of them tomorrow, but Richard, if you feel like helping debugging them, that would be appreciated. Some of them appear in code that I do know know much about, such as module interfaces. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8503#comment:30 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler