summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-24 06:00:30 +0000
committerPaul Phillips <paulp@improving.org>2011-02-24 06:00:30 +0000
commitdd45d81acf8b4e8961406b5b940e1dd70153c2a4 (patch)
tree394a1866f7c93d33a222a820f277f33eacd0c741
parent11b936a03a749606df6612ef9c0a639c75bce765 (diff)
downloadscala-dd45d81acf8b4e8961406b5b940e1dd70153c2a4.tar.gz
scala-dd45d81acf8b4e8961406b5b940e1dd70153c2a4.tar.bz2
scala-dd45d81acf8b4e8961406b5b940e1dd70153c2a4.zip
Reversion of r24319 for causing #4291.
in future attempts. Closes #4291, references #4214, no review.
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala2
-rw-r--r--test/files/run/bug4291.check4
-rw-r--r--test/files/run/bug4291.scala16
-rw-r--r--test/files/run/t3857.check2
-rw-r--r--test/files/run/t3857.scala7
5 files changed, 28 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index a468d71352..70ecea4db5 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -225,7 +225,7 @@ abstract class Erasure extends AddInterfaces
/** The Java signature of type 'info', for symbol sym. The symbol is used to give the right return
* type for constructors.
*/
- def javaSig(sym0: Symbol, info: Type): Option[String] = if (sym0.hasFlag(BRIDGE | MIXEDIN)) None else atPhase(currentRun.erasurePhase) {
+ def javaSig(sym0: Symbol, info: Type): Option[String] = atPhase(currentRun.erasurePhase) {
def jsig(tp: Type, mustBox: Boolean) = {
(boxedClass get tp.typeSymbol) match {
case Some(boxed) if mustBox => jsig2(false, true, Nil, boxed.tpe)
diff --git a/test/files/run/bug4291.check b/test/files/run/bug4291.check
new file mode 100644
index 0000000000..c2b58db6e6
--- /dev/null
+++ b/test/files/run/bug4291.check
@@ -0,0 +1,4 @@
+scala.collection.immutable.List A
+scala.Option A
+scala.Function1 R
+scala.collection.Traversable That
diff --git a/test/files/run/bug4291.scala b/test/files/run/bug4291.scala
new file mode 100644
index 0000000000..3eeaa88be0
--- /dev/null
+++ b/test/files/run/bug4291.scala
@@ -0,0 +1,16 @@
+object Test {
+ def returnType[T: Manifest](methodName: String) = (
+ classManifest[T].erasure.getMethods
+ . filter (x => !x.isBridge && x.getName == methodName)
+ . map (_.getGenericReturnType.toString)
+ )
+ def show[T: Manifest](methodName: String) =
+ println(manifest[T].erasure.getName +: returnType[T](methodName).distinct mkString " ")
+
+ def main(args: Array[String]): Unit = {
+ show[List[_]]("apply")
+ show[Option[_]]("get")
+ show[Function1[_, _]]("apply")
+ show[Traversable[_]]("flatMap")
+ }
+}
diff --git a/test/files/run/t3857.check b/test/files/run/t3857.check
index af416a590b..45e9fb23a6 100644
--- a/test/files/run/t3857.check
+++ b/test/files/run/t3857.check
@@ -1,2 +1,2 @@
private java.util.Set<java.lang.String> ScalaGeneric.s
-private java.util.Set ScalaGeneric2.s
+private java.util.Set<java.lang.String> ScalaGeneric2.s
diff --git a/test/files/run/t3857.scala b/test/files/run/t3857.scala
index 6dfefa22c6..0c8dc996ce 100644
--- a/test/files/run/t3857.scala
+++ b/test/files/run/t3857.scala
@@ -8,5 +8,10 @@ object Test extends App {
// java.util.Set<java.lang.String> ScalaGeneric.s
println(classOf[ScalaGeneric2].getDeclaredField("s").toGenericString)
- // java.util.Set ScalaGeneric2.s -- no signature should be found because it was mixed in.
+ // After r24319 this comment was:
+ // java.util.Set ScalaGeneric2.s -- no signature should be found because it was mixed in.
+ //
+ // Having reverted that with this commit, I note the original comment since
+ // the original signature is also back.
+ // java.util.Set ScalaGeneric2.s -- should be same as above
}