summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2016-05-18 09:45:24 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2016-05-18 09:45:24 +0200
commit39490f709ee6877884b0db11b37605651bfb1bfa (patch)
treeb82ce863b8a6596b1093f9485dff6463aa8024ec
parent4a7f82c9047d04d79aa0fe4c0f8dc249ba221f76 (diff)
parentaf972a5019d0c5e8f4be4363eeed590c8fb384c3 (diff)
downloadscala-39490f709ee6877884b0db11b37605651bfb1bfa.tar.gz
scala-39490f709ee6877884b0db11b37605651bfb1bfa.tar.bz2
scala-39490f709ee6877884b0db11b37605651bfb1bfa.zip
Merge pull request #5174 from retronym/ticket/8756
SI-8756 Fix generic signature for refinement of primitive
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala2
-rw-r--r--test/files/run/t8756.check9
-rw-r--r--test/files/run/t8756.scala22
3 files changed, 32 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 0301e06c87..bc614dfc31 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -344,7 +344,7 @@ abstract class Erasure extends AddInterfaces
buf.toString
case RefinedType(parents, decls) =>
- boxedSig(intersectionDominator(parents))
+ jsig(intersectionDominator(parents), primitiveOK = primitiveOK)
case ClassInfoType(parents, _, _) =>
superSig(parents)
case AnnotatedType(_, atp) =>
diff --git a/test/files/run/t8756.check b/test/files/run/t8756.check
new file mode 100644
index 0000000000..9b9dcafe7d
--- /dev/null
+++ b/test/files/run/t8756.check
@@ -0,0 +1,9 @@
+public Bippy<java.lang.Object> Test.f1(long)
+public Bippy<java.lang.Object> Test.f2(long)
+public Bippy<java.lang.Object> Test.i1(Bippy<java.lang.Object>)
+public Bippy<java.lang.Object> Test.i2(Bippy<java.lang.Object>)
+public int Test.g1(long)
+public int Test.g2(long)
+public java.lang.Object Test.h1(long)
+public java.lang.Object Test.h2(long)
+public static void Test.main(java.lang.String[])
diff --git a/test/files/run/t8756.scala b/test/files/run/t8756.scala
new file mode 100644
index 0000000000..edd243473a
--- /dev/null
+++ b/test/files/run/t8756.scala
@@ -0,0 +1,22 @@
+trait Bippy[A]
+
+class Test {
+ type T1 = Long
+ type T2 = Long { type Tag = Nothing }
+
+ def f1(t: T1): Bippy[Object] = ???
+ def f2(t: T2): Bippy[Object] = ???
+ def g1(t: T1): Int = ???
+ def g2(t: T2): Int = ???
+ def h1(t: T1): Object = ???
+ def h2(t: T2): Object = ???
+ def i1(t: Bippy[T1]): Bippy[T1] = ???
+ def i2(t: Bippy[T2]): Bippy[T2] = ???
+
+}
+
+object Test {
+ def main(args: Array[String]) {
+ println(classOf[Test].getDeclaredMethods.map(_.toGenericString).toList.sorted.mkString("\n"))
+ }
+}