Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/ae9f64bc1d753038dea3610c2461467ecd5eac91

>---------------------------------------------------------------

commit ae9f64bc1d753038dea3610c2461467ecd5eac91
Author: Dimitrios.Vytiniotis <[email protected]>
Date:   Thu Apr 5 22:11:18 2012 +0100

    Following up from the last commit in the constraint solver.

>---------------------------------------------------------------

 tests/perf/compiler/all.T               |    2 +-
 tests/typecheck/should_compile/T3108.hs |   37 +++++++++++++++++++++++++++++++
 tests/typecheck/should_compile/all.T    |    1 +
 3 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/tests/perf/compiler/all.T b/tests/perf/compiler/all.T
index c3f4978..a599ccf 100644
--- a/tests/perf/compiler/all.T
+++ b/tests/perf/compiler/all.T
@@ -123,7 +123,7 @@ test('T4801',
      [''])
 
 test('T3064',
-     [ expect_broken( 3064 ),
+     [# expect_broken( 3064 ),
       # expected value: 9 (x86/Linux 30-03-2011):
       if_wordsize(32,
           compiler_stats_num_field('peak_megabytes_allocated', 7, 12)),
diff --git a/tests/typecheck/should_compile/T3108.hs 
b/tests/typecheck/should_compile/T3108.hs
new file mode 100644
index 0000000..774d5f3
--- /dev/null
+++ b/tests/typecheck/should_compile/T3108.hs
@@ -0,0 +1,37 @@
+{-# LANGUAGE OverlappingInstances, UndecidableInstances, 
MultiParamTypeClasses, 
+             FunctionalDependencies, FlexibleInstances #-}
+
+module T3108 where
+
+-- Direct recursion terminates (typechecking-wise)
+
+class C0 x
+ where
+ m0 :: x -> ()
+ m0 = const undefined
+
+instance (C0 x, C0 y) => C0 (x,y)
+instance C0 Bool
+instance C0 (x,Bool) => C0 x
+
+foo :: ()
+foo = m0 (1::Int)
+
+
+-- Indirect recursion does not terminate (typechecking-wise)
+
+class C1 x
+ where
+ m1 :: x -> ()
+ m1 = const undefined
+
+instance (C1 x, C1 y) => C1 (x,y)
+instance C1 Bool
+instance (C2 x y, C1 (y,Bool)) => C1 x
+
+class C2 x y | x -> y
+instance C2 Int Int
+
+-- It is this declaration that causes nontermination of typechecking.
+bar :: ()
+bar = m1 (1::Int)
diff --git a/tests/typecheck/should_compile/all.T 
b/tests/typecheck/should_compile/all.T
index 76708bb..5fcd89f 100644
--- a/tests/typecheck/should_compile/all.T
+++ b/tests/typecheck/should_compile/all.T
@@ -371,6 +371,7 @@ test('T5643', normal, compile, [''])
 test('T5595', normal, compile, [''])
 test('T5676', normal, compile, [''])
 test('T4310', normal, compile, [''])
+test('T3108', normal, compile, [''])
 
 test('T5792',normal,run_command,
      ['$MAKE -s --no-print-directory T5792'])



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to