Skip to content

Commit 3fa6782

Browse files
committed
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.
1 parent e61e59f commit 3fa6782

File tree

4 files changed

+1
-2
lines changed

4 files changed

+1
-2
lines changed

src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ object Erasure extends TypeTestsCasts{
523523
// Erasure contains an ErasedValueType but the corresponding type in the functional
524524
// interface is not an ErasedValueType.
525525
val bridgeNeeded =
526-
(implResultType :: implParamTypes, samResultType :: samParamTypes).zipped.forall(
526+
(implResultType :: implParamTypes, samResultType :: samParamTypes).zipped.exists(
527527
(implType, samType) => implType.isErasedValueType && !samType.isErasedValueType
528528
)
529529

tests/pending/run/t8017.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)