|
bug: strange type class member accepted: msg#00072lang.haskell.glasgow.bugs
Hi, It appears that GHC 6.0 and 5.04.3 accept this code: module Main where class Foo a where bug :: () -- main is not involved in the problem, just here for completeness main :: IO () main = undefined However, "bug" violates the requirement in the Report: section 4.3.1 Class Declarations class cx => C u where cdecls The type of the top-level class method vi is: vi :: forall u,w. (C u, cxi) =>ti The ti must mention u; ^^^^ The type of "bug" does not mention the variable "a". ghc/ghci accepts this code without error, or even warning, and it is even possible to make instances of this class. However, there does not seem to be any way to use "bug" without getting a type error, so I doubt this is a big problem in practice. For comparison hugs reports a type error message. Cheers, Bernie.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-756429 ] ghc-6.0: panic!, SourceForge.net |
|---|---|
| Next by Date: | [ ghc-Bugs-756429 ] ghc-6.0: panic!, SourceForge.net |
| Previous by Thread: | [ ghc-Bugs-756429 ] ghc-6.0: panic!, SourceForge.net |
| Next by Thread: | [ ghc-Bugs-756454 ] Class op should mention class tyvar, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |