-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #4720 and #4721: account for type inference being too smart #4946
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
Blaisorblade
merged 7 commits into
scala:master
from
dotty-staging:fix-4720-4721-account-for-smarter-type-inference
Aug 21, 2018
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ddf26ee
Refactor
Blaisorblade 040b831
Refactor #2
Blaisorblade 995a81f
Typo
Blaisorblade d84922b
Fix #4720: support smarter type inference
Blaisorblade b06d079
Fix #4721: don't assert constraints are satisfiable
Blaisorblade 6044a54
nonParamBounds: convert result to Bounds if needed
Blaisorblade 69957bb
Positioned.withPos: Only cast where needed
Blaisorblade 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
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
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,4 @@ | ||
object Test { | ||
def main(args: Array[String]):Unit = m(1) // error | ||
def m[Y<:String, Z>:Int, W>:Z<:Y](d:Y):Unit={} | ||
} |
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,4 @@ | ||
object Test { | ||
def main(args: Array[String]):Unit = m("1") // error | ||
def m[Y<:String, Z>:Int, W>:Z<:Y](d:Y):Unit={} | ||
} |
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,4 @@ | ||
object Test { | ||
def main(args: Array[String]):Unit = m(1) | ||
def m[Y<:Int, Z>:Int, W>:Z<:Y](d:Y):Unit={} | ||
} |
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.
Is this comment still correct?
Uh oh!
There was an error while loading. Please reload this page.
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 can't make sense of "@pre
param
is not part of the constraint domain." if that's a precondition. What's the "constraint domain"?Otherwise, I suspect yes.
IIUC, this suggests that in[Y<:String, Z>:Int, W>:Z<:Y]
,nonParamBounds(Y)
andnonParamBounds(Z)
don't includeW
. ButnonParamBounds(W)
should mentionZ
andY
, so it might never have been accurate.EDIT: my patch doesn't affect it, and neither does yours; this comment means, concretely, that we only account for
boundsMap
but notlowerMap
orupperMap
. How information is partitioned between those map is another matter entirely (and might be affected by your patch).