diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-01-31 12:12:23 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-02-01 23:10:55 +0100 |
commit | 1e0707786b118e3e33379e7acdc75306b45e6547 (patch) | |
tree | 2569832d1ee4db3466cec75ce0b8b10431c81f62 /test/pending | |
parent | fbd5efe49cf23b446762dfa5026e8bac82ab04fc (diff) | |
download | scala-1e0707786b118e3e33379e7acdc75306b45e6547.tar.gz scala-1e0707786b118e3e33379e7acdc75306b45e6547.tar.bz2 scala-1e0707786b118e3e33379e7acdc75306b45e6547.zip |
Hardens classToType logic
Reflection now correctly processes classes, objects and inner classes
that are declared in classes and objects.
However classToType still crashes on compound types and local classes.
For more information on those, follow the links:
* Compound types: https://issues.scala-lang.org/browse/SI-5430
* Local classes: https://issues.scala-lang.org/browse/SI-5431
Fixes https://issues.scala-lang.org/browse/SI-5256.
Review by @paulp, @odersky.
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/run/t5256c.check | 0 | ||||
-rw-r--r-- | test/pending/run/t5256c.scala | 10 | ||||
-rw-r--r-- | test/pending/run/t5256g.check | 0 | ||||
-rw-r--r-- | test/pending/run/t5256g.scala | 11 | ||||
-rw-r--r-- | test/pending/run/t5256h.check | 8 | ||||
-rw-r--r-- | test/pending/run/t5256h.scala | 8 |
6 files changed, 37 insertions, 0 deletions
diff --git a/test/pending/run/t5256c.check b/test/pending/run/t5256c.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/pending/run/t5256c.check diff --git a/test/pending/run/t5256c.scala b/test/pending/run/t5256c.scala new file mode 100644 index 0000000000..8ebb51a009 --- /dev/null +++ b/test/pending/run/t5256c.scala @@ -0,0 +1,10 @@ +import scala.reflect.mirror._ + +object Test extends App { + { + class A + val c = classToType(classOf[A]) + println(c) + println(c.typeSymbol == classToSymbol(classOf[A])) + } +} diff --git a/test/pending/run/t5256g.check b/test/pending/run/t5256g.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/pending/run/t5256g.check diff --git a/test/pending/run/t5256g.scala b/test/pending/run/t5256g.scala new file mode 100644 index 0000000000..6158a9281d --- /dev/null +++ b/test/pending/run/t5256g.scala @@ -0,0 +1,11 @@ +import scala.reflect.mirror._ + +class A +trait B + +object Test extends App { + val mutant = new A with B + val c = classToType(mutant.getClass) + println(c) + println(c.typeSymbol == classToSymbol(mutant.getClass)) +} diff --git a/test/pending/run/t5256h.check b/test/pending/run/t5256h.check new file mode 100644 index 0000000000..4f9b8faf71 --- /dev/null +++ b/test/pending/run/t5256h.check @@ -0,0 +1,8 @@ +import scala.reflect.mirror._ + +object Test extends App { + val mutant = new { val x = 2 } + val c = classToType(mutant.getClass) + println(c) + println(c.typeSymbol == classToSymbol(mutant.getClass)) +} diff --git a/test/pending/run/t5256h.scala b/test/pending/run/t5256h.scala new file mode 100644 index 0000000000..4f9b8faf71 --- /dev/null +++ b/test/pending/run/t5256h.scala @@ -0,0 +1,8 @@ +import scala.reflect.mirror._ + +object Test extends App { + val mutant = new { val x = 2 } + val c = classToType(mutant.getClass) + println(c) + println(c.typeSymbol == classToSymbol(mutant.getClass)) +} |