aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-05-23 17:58:16 +0200
committerGuillaume Martres <smarter@ubuntu.com>2015-05-23 18:59:54 +0200
commit3fa6782bbe54afeebb7fca229cebff271421f73a (patch)
treedb78538476afa3fed01a7a0395f56cbe873ab3d6
parente61e59f739d889549993afdd743cbaf71a95c45e (diff)
downloaddotty-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.
-rw-r--r--src/dotty/tools/dotc/transform/Erasure.scala2
-rw-r--r--tests/pending/run/t8017.flags1
-rw-r--r--tests/run/t8017/value-class-lambda.scala (renamed from tests/pending/run/t8017/value-class-lambda.scala)0
-rw-r--r--tests/run/t8017/value-class.scala (renamed from tests/pending/run/t8017/value-class.scala)0
4 files changed, 1 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala
index 749bbed93..1664db456 100644
--- a/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/src/dotty/tools/dotc/transform/Erasure.scala
@@ -523,7 +523,7 @@ object Erasure extends TypeTestsCasts{
// Erasure contains an ErasedValueType but the corresponding type in the functional
// interface is not an ErasedValueType.
val bridgeNeeded =
- (implResultType :: implParamTypes, samResultType :: samParamTypes).zipped.forall(
+ (implResultType :: implParamTypes, samResultType :: samParamTypes).zipped.exists(
(implType, samType) => implType.isErasedValueType && !samType.isErasedValueType
)
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/run/t8017/value-class-lambda.scala
index f247e35f6..f247e35f6 100644
--- a/tests/pending/run/t8017/value-class-lambda.scala
+++ b/tests/run/t8017/value-class-lambda.scala
diff --git a/tests/pending/run/t8017/value-class.scala b/tests/run/t8017/value-class.scala
index 821239305..821239305 100644
--- a/tests/pending/run/t8017/value-class.scala
+++ b/tests/run/t8017/value-class.scala