diff options
author | Paul Phillips <paulp@improving.org> | 2011-06-27 17:16:01 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-06-27 17:16:01 +0000 |
commit | 77c01a9baca66c1a5a099318d403dbedbe4feeeb (patch) | |
tree | 6ee2cd41fae1d25794fd16256d686dcfe30c846b /test/files/run/bug4110.scala | |
parent | 94a00c31680623cd2793b0db87c2bcfac10c9563 (diff) | |
download | scala-77c01a9baca66c1a5a099318d403dbedbe4feeeb.tar.gz scala-77c01a9baca66c1a5a099318d403dbedbe4feeeb.tar.bz2 scala-77c01a9baca66c1a5a099318d403dbedbe4feeeb.zip |
Don't infer anonymous classes.
possible, just far enough to avoid all kinds of undesirable consequences
which accompany the preservation of too much type information. (The
problems are akin to inferring the singleton type too freely.)
// Example of code which did not compile, but now does class A class
B[T <: A](cons: T)
object C extends B(new A {})
Closes #4110, #3048. I already ran this by moors, so review by odersky.
Diffstat (limited to 'test/files/run/bug4110.scala')
-rw-r--r-- | test/files/run/bug4110.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/bug4110.scala b/test/files/run/bug4110.scala new file mode 100644 index 0000000000..a42646ce52 --- /dev/null +++ b/test/files/run/bug4110.scala @@ -0,0 +1,11 @@ +object Test extends App { + def inferredType[T : Manifest](v : T) = println(manifest[T]) + + trait A + trait B + + inferredType(new A with B) + + val name = new A with B + inferredType(name) +}
\ No newline at end of file |