-
Notifications
You must be signed in to change notification settings - Fork 1.1k
opaque type selects different method with -from-tasty #11819
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
Comments
@smarter this one is a problem because at the point of pickling, I would think Noteworthy is that when compiling from source |
Shouldn't findMember find both and pick the one from Double since it has the correct signature? |
@smarter no, it gets // compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
def accessibleDenot(qualType: Type, name: Name, sig: Signature, target: Name) = {
val pre = ctx.typeAssigner.maybeSkolemizePrefix(qualType, name)
val d = qualType.findMember(name, pre).atSignature(sig, target)
val denot =
if (!d.symbol.exists || d.symbol.isAccessibleFrom(pre)) d
else qualType.findMember(name, pre, excluded = Private).atSignature(sig, target)
report.echo(i"$qualType.$name unpickle from SELECT is denot $denot (sig is $sig)")
denot
} we get the log message (Baz.this.i : opaquetypes.Foo).== unpickle from SELECT is denot NoDenotation (sig is Signature(List(scala.Double),scala.Boolean)) |
I think https://github.com/dotty-staging/dotty/commits/thisType-check fixes the problem, can you double-check and take care of integrating it in your PR (sameThis should probably be a method in ThisType...). |
I just tried and it worked, very cool |
We cannot assume that all equivalent ThisType have the same identity (even with hash-consing, they can be constructed from different but equivalent TypeRefs). Co-authored-by: Guillaume Martres <[email protected]>
We cannot assume that all equivalent ThisType have the same identity (even with hash-consing, they can be constructed from different but equivalent TypeRefs). Co-authored-by: Guillaume Martres <[email protected]>
We cannot assume that all equivalent ThisType have the same identity (even with hash-consing, they can be constructed from different but equivalent TypeRefs). Co-authored-by: Guillaume Martres <[email protected]>
We cannot assume that all equivalent ThisType have the same identity (even with hash-consing, they can be constructed from different but equivalent TypeRefs). Co-authored-by: Guillaume Martres <[email protected]>
We cannot assume that all equivalent ThisType have the same identity (even with hash-consing, they can be constructed from different but equivalent TypeRefs). Co-authored-by: Guillaume Martres <[email protected]>
We cannot assume that all equivalent ThisType have the same identity (even with hash-consing, they can be constructed from different but equivalent TypeRefs). Co-authored-by: Guillaume Martres <[email protected]>
Compiler version
3.0.0-RC1
Minimized code
Expectation
Double.==
should also be selected with-from-tasty
, the issue arises when if you actually selectDouble.==
in unpickling then the checker does not expect itThe text was updated successfully, but these errors were encountered: