From bdfb8e754737017c7f4a65d71464cb8878b65f10 Mon Sep 17 00:00:00 2001 From: sof Date: Wed, 5 May 1999 08:35:02 +0000 Subject: [PATCH] [project @ 1999-05-05 08:35:02 by sof] Empty rec pattern test --- ghc/tests/deSugar/should_compile/ds044.hs | 36 +++++++---------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/ghc/tests/deSugar/should_compile/ds044.hs b/ghc/tests/deSugar/should_compile/ds044.hs index 15d7199..fddf194 100644 --- a/ghc/tests/deSugar/should_compile/ds044.hs +++ b/ghc/tests/deSugar/should_compile/ds044.hs @@ -1,30 +1,10 @@ -module Test where +-- !!! Use of empty record patterns for constructors +-- !!! that don't have any labelled fields. According +-- !!! to the report, this isn't illegal. +module ShouldCompile where --- Strict field unpacking tests: compile with -O -funbox-strict-fields. +data F = F Int Int + | G --- test 1: simple unboxed int field -data T = T !Int -t (T i) = i + 1 - --- test 2: mutual recursion (should back off from unboxing either field) -data R = R !R -data S = S !S - -r (R s) = s - --- test 3: multi-level unboxing -data A = A Int !B Int -data B = B !Int - -f = A 1 (B 2) 1 -g (A x (B y) z) = A x (B (y+2)) z -h (A x (B y) z) = y + 2 - --- test 4: flattening nested tuples -data C = C !(Int,Int) -j (C (a,b)) = a + b - --- test 5: polymorphism, multiple strict fields -data D a b = D Int !(a,b) !(E Int) -data E a = E a -k (D a (b,c) (E d)) = a + b + c + d +isF F{} = True +isF _ = False -- 1.7.10.4