Commit 0ac87185 authored by simonpj's avatar simonpj
Browse files

[project @ 2001-10-17 11:13:57 by simonpj]

Add another functional dependency test [oArmin Groesslinger bug]
parent 6c91928f
......@@ -140,5 +140,6 @@ test "tc133" { myvtc("") }
test "tc134" { myvtc("") }
test "tc135" { myvtc("") }
test "tc136" { myvtc("") }
test "tc137" { myvtc("") }
test "tc138" { myvtc("") }
test "tc139" { myvtc("") }
{-# OPTIONS -fglasgow-exts -dcore-lint #-}
{- This one killed GHC 5.02
The problem is that in rather obscure cases (involving functional
dependencies) it is possible to get an AbsBinds [] [] (no tyvars, no
dicts) which nevertheless has some "dictionary bindings". These come
out of the typechecker in non-dependency order, so we need to Rec them
just in case. Otherwise we get a CoreLint out-of-scope error.
Reported by Armin Groesslinger
-}
module ShouldCompile
data X a = X a
class Y a b | a -> b where
y :: a -> X b
instance Y [[a]] a where
y ((x:_):_) = X x
g :: Num a => [X a] -> [X a]
g xs = h xs
where
h ys = ys ++ map (k (y [[0]])) xs
k :: X a -> X a -> X a
k _ _ = y ([] ++ [[]] ++ [])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment