diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-06 10:07:51 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-06 10:07:51 +0000 |
commit | bc9a3475f308e78de193e4072f11e2edb7f7a72b (patch) | |
tree | 5c33f619851c97d015fb3d7daba21fc83483e9c2 /test/files | |
parent | a3d2d3b1ceaa7090a993b4a4f0ea53f4fe343e08 (diff) | |
download | scala-bc9a3475f308e78de193e4072f11e2edb7f7a72b.tar.gz scala-bc9a3475f308e78de193e4072f11e2edb7f7a72b.tar.bz2 scala-bc9a3475f308e78de193e4072f11e2edb7f7a72b.zip |
Re-enabling the disabled signature test along w...
Re-enabling the disabled signature test along with changes which allow
it to pass. Closes #4238 again, no review. (But would anyone like to
expand the signature tests? Great idea, extempore!)
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/JavaInteraction.scala | 2 | ||||
-rw-r--r-- | test/files/jvm/t2585.check | 0 | ||||
-rw-r--r-- | test/files/jvm/t2585/Test.java | 16 | ||||
-rw-r--r-- | test/files/jvm/t2585/genericouter.scala | 25 |
4 files changed, 42 insertions, 1 deletions
diff --git a/test/files/jvm/JavaInteraction.scala b/test/files/jvm/JavaInteraction.scala index 0381d6aa82..26fbc17e58 100644 --- a/test/files/jvm/JavaInteraction.scala +++ b/test/files/jvm/JavaInteraction.scala @@ -16,7 +16,7 @@ p.x = 5 p.c = java.awt.Color[r=255,g=0,b=0] p.getX() = 5.0 p.getC() = java.awt.Color[r=255,g=0,b=0] - """.trim + "\n" + """.trim def connect() = { val p = new ColoredPoint(5, 7, Color.RED); diff --git a/test/files/jvm/t2585.check b/test/files/jvm/t2585.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/jvm/t2585.check diff --git a/test/files/jvm/t2585/Test.java b/test/files/jvm/t2585/Test.java new file mode 100644 index 0000000000..51fe20d81e --- /dev/null +++ b/test/files/jvm/t2585/Test.java @@ -0,0 +1,16 @@ +class J { S s ; } + +public class Test { + public static void main(String[] args) { + final X x = new X(); + final OuterImpl o = new OuterImpl(x); + + final OuterImpl.Inner i1 = o.newInner(); + i1.getT().getI().getT().getI(); // <--- Error: "The method getI() is undefined for the type Object" + + final Outer<X>.Inner i2 = o.newInner(); + i2.getT().getI().getT().getI(); // <--- Error: "The method getI() is undefined for the type Object" + + HashMap<String, String> map = new HashMap<String, String>(); + } +}
\ No newline at end of file diff --git a/test/files/jvm/t2585/genericouter.scala b/test/files/jvm/t2585/genericouter.scala new file mode 100644 index 0000000000..e06aa8101e --- /dev/null +++ b/test/files/jvm/t2585/genericouter.scala @@ -0,0 +1,25 @@ +case class S(n:Int) + +trait TraversableLike[+A, +Repr] { + class WithFilter(p: A => Boolean) + def withFilter(p: A => Boolean): WithFilter = new WithFilter(p) +} + +class HashMap[K, +V] extends TraversableLike[(K, V), HashMap[K, V]] + +class Outer[T](val t: T) { + class Inner { + def getT : T = t + } +} + +class OuterImpl(x: X) extends Outer[X](x) { + def newInner = new Inner +} + +class X { + def getI : Outer[X]#Inner = { + val oImpl = new OuterImpl(this) + new oImpl.Inner + } +}
\ No newline at end of file |