forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix desugaring of context bounds in extensions
Fixes scala#11586 Unfixes scala#11583
- Loading branch information
Showing
8 changed files
with
90 additions
and
89 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,14 @@ | ||
object Test: | ||
|
||
def test1: IArray[Int] = IArray(1, 2) +++ IArray(2, 3) // error | ||
def test2: IArray[Int] = IArray(1, 2) +++ List(2, 3) // error | ||
def test3 = +++[Int](IArray(1, 2))(IArray(2, 3)) | ||
def test4 = +++[Int](IArray(1, 2))(List(2, 3)) | ||
def test5: IArray[Int] = IArray(1, 2).+++[Int](IArray(2, 3)) // error | ||
def test6: IArray[Int] = IArray(1, 2).+++[Int](List(2, 3)) // error | ||
def test7 = +++(IArray(1, 2))[Int](IArray(2, 3)) // error | ||
def test8 = +++(IArray(1, 2))[Int](List(2, 3)) // error | ||
|
||
extension [A: reflect.ClassTag](arr: IArray[A]) | ||
def +++[B >: A: reflect.ClassTag](suffix: IArray[B]): IArray[B] = ??? | ||
def +++[B >: A: reflect.ClassTag](suffix: IterableOnce[B]): IArray[B] = ??? |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
type Conv[T] = [X] =>> X => T | ||
|
||
trait SemiGroup[T]: | ||
extension [U: Conv[T]](x: U) | ||
def combine(y: T): T | ||
extension (x: T) | ||
def combine[U: Conv[T]](y: U): T | ||
|
||
trait Q[T, R: SemiGroup] extends SemiGroup[T]: | ||
def res(x: R, y: R) = x.combine(y) |