|
[ ghc-Bugs-1097046 ] class context restrictions in GADT types not assumed: msg#00078lang.haskell.glasgow.bugs
Bugs item #1097046, was opened at 2005-01-06 09:47 Message generated for change (Settings changed) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1097046&group_id=8032 Category: Compiler (Type checker) Group: 6.4 Status: Open Resolution: None Priority: 5 Submitted By: Ashley Yakeley (ashley-y) >Assigned to: Simon Peyton Jones (simonpj) Summary: class context restrictions in GADT types not assumed Initial Comment: I think this should compile: class C a where f :: a -> Bool data T a where MkT :: (C a) => a -> T a tf1 :: T Int -> Bool tf1 (MkT aa) = f aa tf2 :: T a -> Bool tf2 (MkT aa) = f aa tf1 does not give an error, but tf2 does. The type signature for tf2 should not need a class context, just as there's no "C Int" instance. ThingEncoding.hs:32:23: No instance for (C a) arising from use of `f' at ThingEncoding.hs:32:23 Probable fix: Add (C a) to the type signature(s) for `tf2' In the definition of `tf2': tf2 (MkT aa) = f aa ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1097046&group_id=8032
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1107398 ] internal error: getMBlock: mmap: Invalid argument, SourceForge.net |
|---|---|
| Next by Date: | [ ghc-Bugs-1106211 ] GHC panic, SourceForge.net |
| Previous by Thread: | [ ghc-Bugs-1097046 ] class context restrictions in GADT types not assumed, SourceForge.net |
| Next by Thread: | [ ghc-Bugs-1097471 ] amd64: adjustor creation not supported, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |