Skip to content

Preserve HKTypeLambdas representing kinds in wildApprox #6240

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

Closed
wants to merge 1 commit into from

Conversation

milessabin
Copy link
Contributor

wildApprox should not replace references to type params of HKTypeLambdas which represent kinds with wildcards.

Fixes #6238.

wildApprox should not replace references to type params of HKTypeLambdas
which represent kinds with wildcards.

Fixes #i6238.
@milessabin milessabin added area:typer area:implicits related to implicits labels Apr 4, 2019
@milessabin milessabin requested a review from odersky April 4, 2019 16:27
@odersky
Copy link
Contributor

odersky commented Apr 5, 2019

test performance please

@dottybot
Copy link
Member

dottybot commented Apr 5, 2019

performance test scheduled: 2 job(s) in queue, 1 running.

@dottybot
Copy link
Member

dottybot commented Apr 5, 2019

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6240/ to see the changes.

Benchmarks is based on merging with master (7143421)

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, it's recommended to push your branch to staging and make the PR from there because this makes it easier to collaborate.

tl.paramInfos.forall {
case TypeBounds(lo, hi) =>
def isKindBound(tp: Type): Boolean =
Inferencing.isFullyDefined(tp, ForceDegree.none) || (tp match {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have some explanations about the logic here as a comment. In particular I did not understand why a fully defined bounds represents a kind.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also worried about performance implications. isFullyDefined is not cheap, and wildApprox is a hotspot.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't isKindBound also need to return true for AnyKind? If not, we could use a comment explaining why that's the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just finishing up with a different approach ... no need to continue reviewing this.

@milessabin
Copy link
Contributor Author

Superseded by #6271.

@milessabin milessabin closed this Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:implicits related to implicits area:typer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants