-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #5279: Be more careful where we create symbolic refs from named ones #5287
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
Conversation
6ec2a91
to
7cf7582
Compare
Be more where we create symbolic refs from named ones.
Leave name designators as they are. It makes a difference for the info of the reference.
test performance please |
performance test scheduled: 2 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/5287/ to see the changes. Benchmarks is based on merging with master (d5b885d) |
This is now part of #5300. Anyone care to review it independently? |
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.
The following code fails to compile:
trait BB {
val a: Any
}
trait TT { self: { type T = Int } & BB { val a: T } =>
type T
def lift(x: Int): T = a
}
Error message:
-- [E007] Type Mismatch Error: tests/pos/i5279.scala:7:24 ----------------------
7 | def lift(x: Int): T = a
| ^
| found: TT.this.T(TT.this.a)
| required: TT.this.T
|
one error found
/** Hook that can be called from creation methods in TermRef and TypeRef */ | ||
def validated(implicit ctx: Context): this.type = { | ||
this | ||
} |
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.
validated
is not used?
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.
Yes, I do use if occasionally for debugging, and decided to leave it in for others to use as well if needed.
adapted | ||
else this | ||
result.setDenot(denot) | ||
result.asInstanceOf[ThisType] |
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 guess adapted.eq(this)
is a performance tweak, semantically we can drop it without changing the result.
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.
Exact.
This looks like another instance of the double vision problem described in #5300. |
No description provided.