From 6f86583c83b99e3f4ff28785fe038ded02440961 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 30 Jan 2013 13:26:12 -0800 Subject: SI-6516, macros comparing types with == instead of =:=. I gift-wrapped this ticket four months ago: 'I think it will be enough to say "tpe =:= MacroContextClass.tpe" rather than == .' Indeed. Had to open my own gift. Thanks, paulp! --- test/files/pos/t6516.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/files/pos/t6516.scala (limited to 'test/files') diff --git a/test/files/pos/t6516.scala b/test/files/pos/t6516.scala new file mode 100644 index 0000000000..c004055de2 --- /dev/null +++ b/test/files/pos/t6516.scala @@ -0,0 +1,19 @@ +import scala.language.experimental.macros +import scala.reflect.macros.Context +import scala.collection.TraversableLike + +// This one compiles +object Test { + type Alias[T, CC[_]] = Context { type PrefixType = TraversableLike[T, CC[T]] } + def f() = macro f_impl + def f_impl(c: Alias[Int, List])() = ??? +} + +// This one doesn't +object Test2 { + type Ctx = scala.reflect.macros.Context + type Alias[T, CC[_]] = Ctx { type PrefixType = TraversableLike[T, CC[T]] } + + def f() = macro f_impl + def f_impl(c: Alias[Int, List])() = ??? +} -- cgit v1.2.3