Commit f6dc3979 authored by chak's avatar chak
Browse files

[project @ 2002-09-20 06:13:42 by chak]

Adding a test that checks for SPJ's recent fix entitled "quantify over unbound
type vars in RULE lhs's"
parent 6384a1a3
......@@ -24,3 +24,4 @@ test('tcrun018', normal, compile_and_run, [''])
test('tcrun019', normal, compile_and_run, [''])
test('tcrun020', normal, compile_and_run, [''])
test('tcrun021', normal, compile_and_run, ['-package data'])
test('tcrun022', normal, compile_and_run, ['-O -fglasgow-exts'])
-- This test checks in which way the type checker handles phantom types in
-- RULES. We would like these type variables to be generalised, but some
-- versions of GHC instantiated them to `()', which seriously limited the
-- applicability of such RULES.
module Main (main)
data T a = C
foo :: T a -> String
{-# NOINLINE foo #-}
foo C = "rewrite rule did NOT fire"
-- this rule will not fire if the type argument of `T' is constrained to `()'
"foo/C" foo C = "rewrite rule did fire"
main = putStrLn $ foo (C :: T Int)
Supports Markdown
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