Allow marking a class as virtual. #8068
Unanswered
moonheart08
asked this question in
Language Ideas
Replies: 2 comments 2 replies
-
The attribute + analyzer route seems ideal here. Esp. as it would not require a new lang version, and already works (virtually on every Roslyn compiler version out there). |
Beta Was this translation helpful? Give feedback.
0 replies
-
What is a "virtual" class? One that must be inherited to be used? Isn't that just an abstract class? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In short, allow requiring the programmer to be explicit about the usage for their class (inheritable and constructable, sealed and constructable, or inheritable and abstract), through a disabled-by-default warning.
This would enable the workflow I've seen in some repositories like https://github.com/space-wizards/space-station-14 where the usage of a class must be specified explicitly to be done without a custom analyzer and attribute (
[Virtual]
in the case of that repo)(I'm entirely up for implementing this myself.)
Beta Was this translation helpful? Give feedback.
All reactions