[GHC] #8138: Core lint fails with error "Role incompatibility: expected N, got R"
#8138: Core lint fails with error "Role incompatibility: expected N, got R" ------------------------------------+------------------------------------- Reporter: gmainland | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Other Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- I'm seeing a core lint error, "Role incompatibility: expected N, got R", on 333273792479695cf79a72cffa4c579d0c9deb21. The attached program will reproduce the error when compiled as: {{{ ghc -O2 -dcore-lint Role.hs }}} Note that `-O2` is required for core lint to complain. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8138> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8138: Core lint fails with error "Role incompatibility: expected N, got R" -------------------------------------+------------------------------------ Reporter: gmainland | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by goldfire): This is actually a bug in core lint, not in the code generation -- core lint doesn't consider the possibility of `(~R#)` arguments to functions, but some optimizations produce these. Patch on the way... If this is holding you up at the moment, just delete line 404 of !CoreLint.lhs "` ; checkRole co Nominal role`". -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8138#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8138: Core lint fails with error "Role incompatibility: expected N, got R" -------------------------------------+------------------------------------ Reporter: gmainland | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Richard Eisenberg <eir@…>): In [changeset:ac382ab999dfcc612550f0ea95e750fe44ba4a9d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="ac382ab999dfcc612550f0ea95e750fe44ba4a9d" Fix Trac #8138. The code in CoreLint did not take into account the possibility of ~R# arguments to functions. These can arise in argToPat in SpecConstr. Now, CoreLint does not fail when it sees a ~R# parameter. This commit also updates the core-spec document accordingly. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8138#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8138: Core lint fails with error "Role incompatibility: expected N, got R" -------------------------------------+------------------------------------ Reporter: gmainland | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Richard Eisenberg <eir@…>): In [changeset:ea96a0fcb5c756f5c2c77f8bc651b3345ca6d09f/testsuite]: {{{ #!CommitTicketReference repository="testsuite" revision="ea96a0fcb5c756f5c2c77f8bc651b3345ca6d09f" Add testcase for #8138 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8138#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8138: Core lint fails with error "Role incompatibility: expected N, got R" -------------------------------------+------------------------------------- Reporter: gmainland | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Easy (less than 1 Test Case: | hour) deriving/should_compile/T8138 | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * difficulty: Unknown => Easy (less than 1 hour) * testcase: => deriving/should_compile/T8138 Comment: Thanks for reporting this! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8138#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8138: Core lint fails with error "Role incompatibility: expected N, got R" -------------------------------------+------------------------------------- Reporter: gmainland | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Easy (less than 1 Test Case: | hour) deriving/should_compile/T8138 | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by goldfire): * status: merge => closed * resolution: => fixed Comment: Oops -- just noticed that I flagged this as "merge" instead of closed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8138#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC