-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3710 from dotty-staging/fix-#2994
Fix #1905: Detect case where bridge would clash with the member
- Loading branch information
Showing
3 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Arr[T](private val underlying: scala.Array[T]) extends AnyVal | ||
|
||
abstract class SeqMonoTransforms[+A, +Repr] { | ||
protected[this] def fromIterableWithSameElemType(): Repr | ||
def getFIWSET: Repr = fromIterableWithSameElemType() | ||
} | ||
|
||
class ArrOps[A](val xs: Arr[A]) extends SeqMonoTransforms[A, Arr[A]] { | ||
def fromIterableWithSameElemType(): Arr[A] = xs // error: bridge clashes with member | ||
} | ||
|
||
object Test { | ||
def main(args: Array[String]) = { | ||
val t = new ArrOps(new Arr(Array(1, 2, 3))) | ||
val t2 = t.getFIWSET | ||
} | ||
} |