|
[ ghc-Bugs-1201666 ] Default methods not in scope for spliced-in instances?: msg#00060lang.haskell.glasgow.bugs
Bugs item #1201666, was opened at 2005-05-13 17:16 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1201666&group_id=8032 Category: Template Haskell Group: 6.4 Status: Open Resolution: None Priority: 5 Submitted By: Samuel Bronson (sbronson) Assigned to: Simon Peyton Jones (simonpj) Summary: Default methods not in scope for spliced-in instances? Initial Comment: This is a literate haskell bugreport. Save it to DefaultMethodScopeTH.lhs. I noticed a problem with instantiating a typeclasse from Template Haskell in the same module that defined it. I've bumped into this twice close together now, so I figure I really ought to report it now. > {-# OPTIONS_GHC -fth #-} > > module DefaultMethodScopeTH where First, define a typeclass with a default method. This is probably not a very usefull class, but nobody wants me to drag half of the module I'm actually working on into this ;-). > class Foo a where > foo :: a -> a > foo = id Now try to instantiate it from TH with the default method. > $([d| instance Foo () where |]) Nothing particularly complicated, right? But when I try to actually build it, I get this: $ ghc --make DefaultMethodScopeTH.lhs Chasing modules from: DefaultMethodScopeTH.lhs Compiling DefaultMethodScopeTH ( DefaultMethodScopeTH.lhs, DefaultMethodScopeTH.o ) DefaultMethodScopeTH.lhs:22:7: GHC internal error: `DefaultMethodScopeTH.$dmfoo' is not in scope In the definition of `foo': foo = DefaultMethodScopeTH.$dmfoo In the definition for method `foo' In the instance declaration for `Foo ()' Kind of nasty, eh? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1201666&group_id=8032
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1198765 ] make depend of ghc-6.5 segfaults on x86-64, SourceForge.net |
|---|---|
| Next by Date: | [ ghc-Bugs-1201666 ] Default methods not in scope for spliced-in instances?, SourceForge.net |
| Previous by Thread: | [ ghc-Bugs-1200592 ] GHC fails to pass dictionary in a rank-2 situation., SourceForge.net |
| Next by Thread: | [ ghc-Bugs-1201666 ] Default methods not in scope for spliced-in instances?, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |