[project @ 1997-07-26 23:12:13 by sof]
[ghc-hetmet.git] / ghc / tests / deSugar / should_run / ds006.hs
1 {- 
2 Date: Tue, 20 May 1997 05:10:04 GMT
3 From: Tomasz Cholewo <tjchol01@mecca.spd.louisville.edu>
4
5 ghc-2.03 cannot compile the following code, which I think is correct
6 according to the Report
7
8         data X = A {a :: Int} | B {a :: Int}
9
10 The error message is: 
11
12     Conflicting definitions for:  a
13         Defined at bug4.lhs:2
14         Defined at bug4.lhs:2
15
16 In addition the following snippet
17
18         data X = A {a :: Int}
19         y = let A {a} = x
20             in a
21
22 fails with:
23
24     bug4.lhs:4:5: Not a valid LHS on input: "in"
25 -}
26 --module Main(main) where
27
28 data X = A {a :: Int} | B {a :: Int}
29
30 f x = let A {a} = x
31       in a
32
33 main = print (f (A {a = 3}))