diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-19 19:21:32 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-19 19:27:11 +0200 |
commit | 4fc9cdb64f577e0561e814377ea0f9747245bbbe (patch) | |
tree | e5d169a110dfe802de665a06a728d124d783f291 /test | |
parent | d9b65592df28e8c9655b52c0265f499d757617ba (diff) | |
download | scala-4fc9cdb64f577e0561e814377ea0f9747245bbbe.tar.gz scala-4fc9cdb64f577e0561e814377ea0f9747245bbbe.tar.bz2 scala-4fc9cdb64f577e0561e814377ea0f9747245bbbe.zip |
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(<C.this.A.type>.symbol), you'll
get a path like `OwnerOfA.this.A`,
where `OwnerOfA` might be a superclass of `C`, and
explicitouter won't like that
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t4897.check | 1 | ||||
-rw-r--r-- | test/files/run/t4897.scala | 10 |
2 files changed, 11 insertions, 0 deletions
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 |