diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-05-23 17:58:16 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2015-05-23 18:59:54 +0200 |
commit | 3fa6782bbe54afeebb7fca229cebff271421f73a (patch) | |
tree | db78538476afa3fed01a7a0395f56cbe873ab3d6 /tests/pending/run | |
parent | e61e59f739d889549993afdd743cbaf71a95c45e (diff) | |
download | dotty-3fa6782bbe54afeebb7fca229cebff271421f73a.tar.gz dotty-3fa6782bbe54afeebb7fca229cebff271421f73a.tar.bz2 dotty-3fa6782bbe54afeebb7fca229cebff271421f73a.zip |
Fix bridge creation for value classes
As the comment in the code says:
"In general, a bridge is needed when the signature of the closure method after
Erasure contains an ErasedValueType but the corresponding type in the functional
interface is not an ErasedValueType."
So we need to check if _at least one_ of the type needs to be adapted,
not if _all of them_ need to, the use of "forall" was an error.
Diffstat (limited to 'tests/pending/run')
-rw-r--r-- | tests/pending/run/t8017.flags | 1 | ||||
-rw-r--r-- | tests/pending/run/t8017/value-class-lambda.scala | 40 | ||||
-rw-r--r-- | tests/pending/run/t8017/value-class.scala | 3 |
3 files changed, 0 insertions, 44 deletions
diff --git a/tests/pending/run/t8017.flags b/tests/pending/run/t8017.flags deleted file mode 100644 index 48b438ddf..000000000 --- a/tests/pending/run/t8017.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/tests/pending/run/t8017/value-class-lambda.scala b/tests/pending/run/t8017/value-class-lambda.scala deleted file mode 100644 index f247e35f6..000000000 --- a/tests/pending/run/t8017/value-class-lambda.scala +++ /dev/null @@ -1,40 +0,0 @@ -object Test { - def testC: Unit = { - val f1 = (c: C) => c.value - val f2 = (x: Int) => new C(x) - val f3 = (c1: C) => (c2: C) => (c1, c2) - val r1 = f2(2) - val r2 = f2(2) - val r3 = f3(r1)(r2) - val result = f1(r3._2) - assert(result == 2) - } - - def testD: Unit = { - val f1 = (c: D) => c.value - val f2 = (x: String) => new D(x) - val f3 = (c1: D) => (c2: D) => (c1, c2) - val r1 = f2("2") - val r2 = f2("2") - val r3 = f3(r1)(r2) - val result = f1(r3._2) - assert(result == "2") - } - - def testE: Unit = { - val f1 = (c: E[Int]) => c.value - val f2 = (x: Int) => new E(x) - val f3 = (c1: E[Int]) => (c2: E[Int]) => (c1, c2) - val r1 = f2(2) - val r2 = f2(2) - val r3 = f3(r1)(r2) - val result = f1(r3._2) - assert(result == 2) - } - - def main(args: Array[String]): Unit = { - testC - testD - testE - } -} diff --git a/tests/pending/run/t8017/value-class.scala b/tests/pending/run/t8017/value-class.scala deleted file mode 100644 index 821239305..000000000 --- a/tests/pending/run/t8017/value-class.scala +++ /dev/null @@ -1,3 +0,0 @@ -class C(val value: Int) extends AnyVal -class D(val value: String) extends AnyVal -class E[A](val value: A) extends AnyVal |