-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix caching of TermRef #5808
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
Fix caching of TermRef #5808
Conversation
@@ -752,15 +752,15 @@ object Denotations { | |||
|
|||
/** The TypeRef representing this type denotation at its original location. */ | |||
def typeRef(implicit ctx: Context): TypeRef = | |||
TypeRef(symbol.owner.thisType, symbol.name.asTypeName, this) | |||
TypeRef(symbol.owner.thisType, symbol) |
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.
@odersky what about TermRef(symbol.owner.thisType, symbol).withDenot(this)
?
This commit fixes a bug found in implementing ScalaTest macros, where `findMember("===")` returns 3 difference single denotations, but `alternatives.map(_.termRef)` returns 3 types of which the last 2 are the same. This causes an assertion failure in overloading resolution. Unfortunately we are unable to create a minimized test.
59d981a
to
9ed41c6
Compare
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 looks like the right fix to me.
I'm not sure so sure, |
If we assume |
The fix restricts that we only call `.termRef` and `.typeRef` on `SymDenotation`.
This commit fixes a bug found in implementing ScalaTest macros, where
findMember("===")
returns 3difference single denotations, but
alternatives.map(_.termRef)
returns 3types of which the last 2 are the same. This causes an assertion failure in overloading resolution.
Unfortunately we are unable to create a minimized test.