generate getters and setters consistently with qnames#451
Draft
mikesamuel wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Mike Samuel <mikesamuel@gmail.com>
mikesamuel
commented
Jun 30, 2026
| .snapshot(configKey, AstSnapshotKey, root) | ||
| } | ||
|
|
||
| Debug.Frontend.DefineStage.FillInMissingQNames(configKey) |
Contributor
Author
There was a problem hiding this comment.
Just make sure there're qnames on anything that was added since.
| | I__0<T__0> extends AnyValue; | ||
| | @property(\x) @visibility(\public) @QName("test-code.type I.x") @stay @fromType(I__0<T__0>) let x__3: T__0; | ||
| | @property(\y) @visibility(\public) @QName("test-code.type I.y") @stay @fromType(I__0<T__0>) let y__1; | ||
| | @property(\y) @visibility(\public) @stay @fromType(I__0<T__0>) @QName("test-code.type I.y") let y__1: Int32; |
Contributor
Author
There was a problem hiding this comment.
Now when there's a setter, we infer the type of the abstract property properly.
Contributor
|
Overall looking good. And I can't tell from a glance, but for interfaces, I think it would be good to generate the exact same internal representation for either of these: interface Hi {
message: String;
var name: String;
}interface Hi {
get message(): String;
get name(): String;
set name(name: String);
}Maybe we should prefer one to the other, but from an interface perspective, I think these should mean the same thing. These would be different for classes, though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trying to see if generating getters and setters (including pureVirtual ones for interfaces) might simplify some things.
Still need to maybe drop pureVirtual bodies to make declaring abstract easier and make it easier for backends that only want getters and setters when they are semantically different from a direct read of a backed property to skip such setters and getters.