-
Notifications
You must be signed in to change notification settings - Fork 1.1k
allow annotations to annotate themselves #24447
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
| else | ||
| newSymbol(ctx.owner, name, flags, completer, privateWithin, coord) | ||
| } | ||
| registerSym(start, sym) |
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.
We need to register the symbol before we resolve the annotations (2 lines below)
| case name: Name => name == sym.name && tp.symbol == sym | ||
| case _ => tp.symbol == sym | ||
| case _ => this.symbol == sym | ||
| readLater(end, reader => |
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.
We delay it because reading the type of the annotation tp will fail; we prepare this call before registering the symbol and we cannot do it after.
odersky
left a comment
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 changes to the unpickler LGTM
This specific feature was removed when #1212 was solved. The issue was always the unpickler crashing.
In this PR, we actually fix the unpickler and recover the old behaviour. The main reason for this PR is #23770.