Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0f996392cf844592addde3404a94f567e2acc4ba

>---------------------------------------------------------------

commit 0f996392cf844592addde3404a94f567e2acc4ba
Author: Simon Peyton Jones <[email protected]>
Date:   Mon Aug 22 08:58:24 2011 +0100

    Comments only

>---------------------------------------------------------------

 compiler/typecheck/TcTyClsDecls.lhs |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/compiler/typecheck/TcTyClsDecls.lhs 
b/compiler/typecheck/TcTyClsDecls.lhs
index 11c2930..b7dc847 100644
--- a/compiler/typecheck/TcTyClsDecls.lhs
+++ b/compiler/typecheck/TcTyClsDecls.lhs
@@ -1178,6 +1178,7 @@ E.g.
         data T where
           T1 { f :: Maybe a } :: T [a]
           T2 { f :: Maybe a, y :: b  } :: T [a]
+         T3 :: T Int
 
 and now the selector takes that result type as its argument:
    f :: forall a. T [a] -> Maybe a
@@ -1192,6 +1193,7 @@ So the selector loooks like this:
      = case t of
         T1 c   (g:[a]~[c]) (v:Maybe c)       -> v `cast` Maybe (right (sym g))
          T2 c d (g:[a]~[c]) (v:Maybe c) (w:d) -> v `cast` Maybe (right (sym g))
+         T3 -> error "T3 does not have field f"
 
 Note the forall'd tyvars of the selector are just the free tyvars
 of the result type; there may be other tyvars in the constructor's



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to