Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test files for name ambiguity

  • Loading branch information...
commit 9fce52659afcfad4f5ccb41bafecc43d0821aa00 1 parent c4e198f
@atzedijkstra atzedijkstra authored
View
22 EHC/test/regress/99/NameAmbigPatternCon.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE NoGenericDeriving #-}
+
+{- ----------------------------------------------------------------------------------------
+ what : test for bug which did not detect ambiguous name references
+ expected: error messages about 4 available occurrences
+---------------------------------------------------------------------------------------- -}
+
+module NameAmbigPatternCon where
+
+import NameAmbigPatternConImpMod1
+import NameAmbigPatternConImpMod2
+
+-- intentional duplicate def
+-- data Maybe a = Nothing | Just a
+data Maybe a = Nothing | Just a
+
+-- should give error
+f (Just a) = id a
+
+id x = x
+
+main = return ()
View
20 EHC/test/regress/99/NameAmbigPatternConImpMod1.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE NoGenericDeriving #-}
+
+{- ----------------------------------------------------------------------------------------
+ what : NameAmbigPatternCon
+ expected: not to be tested on its own
+ constraints: exclude-if-js
+ constraints: exclude-if-bc
+---------------------------------------------------------------------------------------- -}
+
+module NameAmbigPatternConImpMod1 where
+
+import Prelude hiding (Maybe(..), id)
+
+-- intentional duplicate def
+data Maybe a = Nothing | Just a
+
+-- should give error
+f (Just a) = id a
+
+id x = x
View
20 EHC/test/regress/99/NameAmbigPatternConImpMod2.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE NoGenericDeriving #-}
+
+{- ----------------------------------------------------------------------------------------
+ what : NameAmbigPatternCon
+ expected: not to be tested on its own
+ constraints: exclude-if-js
+ constraints: exclude-if-bc
+---------------------------------------------------------------------------------------- -}
+
+module NameAmbigPatternConImpMod2 where
+
+import Prelude hiding (Maybe(..), id)
+
+-- intentional duplicate def
+data Maybe a = Nothing | Just a
+
+-- should give error
+f (Just a) = id a
+
+id x = x
Please sign in to comment.
Something went wrong with that request. Please try again.