[GHC] #15759: GHC doesn't use fixity in type instances

#15759: GHC doesn't use fixity in type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.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: -------------------------------------+------------------------------------- If I say {{{#!hs data a * b infixl 7 * type family a + b infixl 6 + type instance Int * Bool + Double = Float }}} (with `-XNoStarIsType` -- `*` is not the issue here) I get {{{ • Illegal family instance for ‘*’ (* is not an indexed type family) • In the type instance declaration for ‘*’ }}} But that's wrong. The `*` should bind tighter than the `+`, meaning this is an instance for `+`, not `*`. This also fails for closed type families: {{{#!hs data a * b infixl 7 * type family a + b where Int * Bool + Double = Float infixl 6 + }}} Interestingly, a ''class'' instance works here. This did not bite me "in the wild", but came up while reading the GHC source code. Still, it is a real bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15759 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15759: GHC doesn't use fixity in type instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11307 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #11307 Comment: See also #11307. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15759#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC