You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generate Match and Switch with the parent's subclasses #757
I feel like this is very much out of scope from the original goal of this source generator which is that it generates Match methods for hierarchies that are at the same time nested in one big class/record.
If we were to implement this, we'd need to carefully consider the implementation of our incremental generator:
We are provided with the syntax node (in the example above that would be record Result { ... }, not the semantic model of the record Result
Getting the parent class is an operation on the semantic model, we get the semantic model in a second step after we're provided with the syntax node.
I don't know how we would tell Roslyn should also track the parent class' syntax node and rerun our generator for changes (This is important when you use the generator in your IDE).
Activity
tautropfli commentedon Nov 7, 2023
I feel like this is very much out of scope from the original goal of this source generator which is that it generates
Matchmethods for hierarchies that are at the same time nested in one big class/record.If we were to implement this, we'd need to carefully consider the implementation of our incremental generator:
record Result { ... }, not the semantic model of the recordResultFreeApophis commentedon Sep 24, 2026
Closed: see parent item.