diff options
author | David Terei <davidterei@gmail.com> | 2011-07-20 11:09:03 -0700 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-07-20 11:26:35 -0700 |
commit | 16514f272fb42af6e9c7674a9bd6c9dce369231f (patch) | |
tree | e4f332b45fe65e2a7a2451be5674f887b42bf199 /testsuite/tests/deSugar/should_run/dsrun005.hs | |
parent | ebd422aed41048476aa61dd4c520d43becd78682 (diff) | |
download | haskell-16514f272fb42af6e9c7674a9bd6c9dce369231f.tar.gz |
Move tests from tests/ghc-regress/* to just tests/*
Diffstat (limited to 'testsuite/tests/deSugar/should_run/dsrun005.hs')
-rw-r--r-- | testsuite/tests/deSugar/should_run/dsrun005.hs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/dsrun005.hs b/testsuite/tests/deSugar/should_run/dsrun005.hs new file mode 100644 index 0000000000..238a2c3410 --- /dev/null +++ b/testsuite/tests/deSugar/should_run/dsrun005.hs @@ -0,0 +1,46 @@ +{- + +From: Olaf Chitil <chitil@Informatik.RWTH-Aachen.DE> + +It is a problem with 0.29 (which we use for compiling 2.01), it is gone +in 2.01. + + f :: Eq a => a -> [b] -> [b] -> Bool + f a [] [] = (a==a) + main = print (f True "" "Hallo") + + +when run after compilation with 0.29 you get: +Fail: "test.hs", line 6: incomplete pattern(s) to match in function "ds.d5b4" + +while 2.01 gives you as desired +Fail: In pattern-matching: function f{-aYw-}; at test.hs, line 6 + +The problem is the dictionary, because for the program + + f :: a -> [b] -> [b] -> Bool + f a [] [] = True + main = print (f True "" "Hallo") + +0.29 gives the function name "f" as well. + +So it's ok in 2.01, but why did you change the form of the error messages? +"incomplete pattern(s) to match" is more informative then "In pattern-matching"! +I even prefer the order of information in the 0.29 error messages. + +May I finally repeat that in my opinion the compiler should warn about +incomplete patterns during compilation. However, I suppose the +incomplete patterns are just recognised by the desugarer which does +not produce error messages any more. + +-} + + +module Main where + +f :: Eq a => a -> [b] -> [b] -> Bool +f a [] [] = (a==a) + +main = print (f True "" "Hallo") + + |