Bugs item #1300895, was opened at 2005-09-23 14:12
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=1300895&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Bjorn Bringert (bring)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incomplete pattern warnings with GADTs

Initial Comment:
{-
  With GADTs, -fwarn-incomplete-patterns complains
about missing
  impossible cases.
-}

{-# OPTIONS_GHC -fglasgow-exts
-fwarn-incomplete-patterns #-}

data Var = Var
data Typ = Typ

data Tree a where
   V       :: String -> Tree Var
   T_int   :: Tree Typ

getId :: Tree Var -> String
getId (V x) = x
--getId T_int = "T_int"

{-

With the last line commented out:

gadt-pattern-warning.hs:11:0:
    Warning: Pattern match(es) are non-exhaustive
             In the definition of `getId': Patterns not
matched: T_int
Ok, modules loaded: Main.


With the last line not commented out:
gadt-pattern-warning.hs:12:6:
    Inaccessible case alternative: Can't match types
`Typ' and `Var'
    When checking the pattern: T_int
    In the definition of `getId': getId T_int = "T_int"
Failed, modules loaded: none.

-}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1300895&group_id=8032
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to