-
Notifications
You must be signed in to change notification settings - Fork 5
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
Type hierarchy use type #123
base: main
Are you sure you want to change the base?
Conversation
fff98d3
to
3a923d2
Compare
} | ||
|
||
bool get isMember => wireType == WireType.member; | ||
Member? get maybeMember => isMember ? asMember : null; |
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.
nit: maybe ifMember
? I don't feel strongly either way though.
We probably also want to avoid looking up wireType
twice here.
final path = MacroScope.current.model.pathOf(node)!; | ||
final secondLast = path[path.length - 2]; | ||
switch (secondLast) { | ||
case 'members': |
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.
I definitely would want something more robust here, it needs to be something we can auto-generate as well I think.
In general, I don't love the idea of using the path to the node for this this, it feels sketchy and I worry about the backwards compatibility of it if the schema changes.
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.
Agreed, I'm happy to drop the path idea in favour of putting "static fields" in schemas, that seems much better and can be used for any of the approaches.
No description provided.