[GHC] #9167: Associated type is accepted even without mentioning class parameters
#9167: Associated type is accepted even without mentioning class parameters ------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- The following module is accepted: {{{ {-# LANGUAGE TypeFamilies #-} module Bug where class C a where type F b }}} Note that the associate type family `F` does not mention the class variable `a`. Because associated type families are somewhat thin sugar over non-associated type families, I doubt this causes any great disaster anywhere, but it should probably be fixed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9167> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9167: Associated type is accepted even without mentioning class parameters -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by archblob): This is not 7.8.2 specific, it originated in 7.4.1. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9167#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9167: Associated type is accepted even without mentioning class parameters -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"66bddbb27fd9c383f85005b8c6e1961d25d7a7dd/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="66bddbb27fd9c383f85005b8c6e1961d25d7a7dd" Check that an associated type mentions at least one type variable from the class Fixes Trac #9167 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9167#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9167: Associated type is accepted even without mentioning class parameters -------------------------------------------------+------------------------- Reporter: goldfire | Owner: Type: bug | Status: Priority: low | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.8.2 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Test Case: | Unknown/Multiple indexed_types/should_fail/T9167 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by simonpj): * status: new => closed * testcase: => indexed_types/should_fail/T9167 * resolution: => fixed Comment: Good point. Done. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9167#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9167: Associated type is accepted even without mentioning class parameters -------------------------------------------------+------------------------- Reporter: goldfire | Owner: Type: bug | Status: Priority: low | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.8.2 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Test Case: | Unknown/Multiple indexed_types/should_fail/T9167 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by archblob): The error message now says {{{ The associated type ‘F’ mentions none of the type variables of the class ‘C k a’ In the class declaration for ‘C’ }}} but {{{#!haskell class C (a :: k) where type F (b :: k) }}} is accepted although none of the class type variables are mentioned in the definition for `F` . If this is the intended behavior maybe the error message should say type or kind variables. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9167#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9167: Associated type is accepted even without mentioning class parameters -------------------------------------------------+------------------------- Reporter: goldfire | Owner: Type: bug | Status: Priority: low | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.8.2 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Test Case: | Unknown/Multiple indexed_types/should_fail/T9167 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"1153194ca1ec867ca01675a902cdf7dab72b5dab/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="1153194ca1ec867ca01675a902cdf7dab72b5dab" Clarify error message. See #9167. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9167#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC