From 4fc9cdb64f577e0561e814377ea0f9747245bbbe Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 19 Jul 2012 19:21:32 +0200 Subject: SI-4897 derive expected value from single type when the type in a type test is, say, `C.this.A.type`, must use the corresponding term `C.this.A` to test for equality if you use the naive REF(.symbol), you'll get a path like `OwnerOfA.this.A`, where `OwnerOfA` might be a superclass of `C`, and explicitouter won't like that --- test/files/run/t4897.check | 1 + test/files/run/t4897.scala | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 test/files/run/t4897.check create mode 100644 test/files/run/t4897.scala (limited to 'test') diff --git a/test/files/run/t4897.check b/test/files/run/t4897.check new file mode 100644 index 0000000000..17dda56fe1 --- /dev/null +++ b/test/files/run/t4897.check @@ -0,0 +1 @@ +joepie diff --git a/test/files/run/t4897.scala b/test/files/run/t4897.scala new file mode 100644 index 0000000000..a2ec3de37f --- /dev/null +++ b/test/files/run/t4897.scala @@ -0,0 +1,10 @@ +class CSuper { + object A +} +class C extends CSuper { + def f = (A: AnyRef) match { case _: A.type => "joepie" } +} + +object Test extends C with App { + println(f) +} \ No newline at end of file -- cgit v1.2.3