-
Notifications
You must be signed in to change notification settings - Fork 1.1k
package object member "type X" not found if "object X" exists in the same package #2200
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
The problem seems to be that the stuff in the package object is not found, I've seen that happen before. The reason is that we cache the package object denotation, but sometimes we cache it before the package object has been entered into scope, so the cache is wrong and never invalidated. I don't know if there's a systematic solution to this, maybe simply dropping the cache assuming it doesn't have a big impact on performance? /cc @odersky
That's a good one! No clue what's going on but it shouldn't be too hard to debug. @olafurpg Since these are two separate issues, would you mine splitting this issue into two? |
It's not just a caching problem. The problem is that the first type found is the class type that comes with the DocString object, but that one does not really exist. But by then we don't look in the package object anymore. It's tricky because at the point where we do look into the package object we are not allowed to ask whether the companion class really exists, as that would force too much. |
@odersky Ah, I see! So it's not the issue I thought it was. |
Fixed by #2205 |
I confirm that I'm unable to reproduce the error after #2205. |
I found one example with type aliases and higher kinded types where scalac reports no type errors while dotc reports E006 Unbound Identifier Error cf26eeb#commitcomment-21672034
I bumped into this error while trying to compile https://github.com/johnynek/paiges with Dotty. The commands I ran were
The text was updated successfully, but these errors were encountered: