-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3467: Don't pre-check kinds in TypeAssigner #3567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,11 @@ | ||
trait A { type L[X] } | ||
trait B { type L } | ||
trait C { type M <: A } | ||
trait D { type M >: B } | ||
|
||
object Test { | ||
def test(x: C with D): Unit = { | ||
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L has wrong kind | ||
f(new B { type L[F[_]] = F[F] })(1) // error: F has wrong kind | ||
} | ||
} |
This file contains hidden or 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,16 @@ | ||
object Test { | ||
|
||
class C[T] | ||
class C2[T[X]] | ||
|
||
class B | ||
|
||
val x: C[C] = ??? // error: Type argument has not the same kind as its bound | ||
val y: C2[C] = ??? | ||
|
||
def f[T] = ??? | ||
|
||
def f2[T[X]] = ??? | ||
|
||
f2[C] | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
package collection | ||
|
||
class Test { | ||
def test(xs: Array[Int]): Unit = { | ||
new ArrayOps(xs) | ||
} | ||
} |
This file contains hidden or 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,21 @@ | ||
package collection | ||
|
||
abstract class WithFilter[+A, +CC[_]] | ||
|
||
trait IndexedSeq[+A] extends Any with IndexedSeqOps[A, IndexedSeq, IndexedSeq[A]] | ||
|
||
trait IndexedSeqOps[+A, +CC[X] <: IndexedSeq[X], +C] extends Any { | ||
def withFilter(p: A => Boolean): WithFilter[A, CC] = ??? | ||
} | ||
|
||
package immutable { | ||
trait IndexedSeq[+A] extends collection.IndexedSeq[A] with collection.IndexedSeqOps[A, IndexedSeq, IndexedSeq[A]] | ||
} | ||
|
||
object ArrayOps { | ||
abstract class WithFilter[A] extends collection.WithFilter[A, immutable.IndexedSeq] | ||
} | ||
|
||
class ArrayOps[A](val xs: Array[A]) extends AnyVal with IndexedSeqOps[A, immutable.IndexedSeq, Array[A]] { | ||
override def withFilter(p: A => Boolean): ArrayOps.WithFilter[A] = ??? | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file and kinds2.scala are almost identitical, the other one could be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinds2.scala
tests another error. So I think we should keep itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not test
f[C]
in this file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe because the error is not reported with this file: