Skip to content

Investigate Changes Needed for C# 11 #162

@JasonBock

Description

@JasonBock

There are a couple of features that I think will affect Rocks. I want to see how much work it'll take to support them.

  • Static abstract members in interfaces - If an interface has a static abstract member (which I would believe includes methods and properties, maybe events as well?), we have to implement it as a static member.
  • Generic attributes - If a type, method, parameter, etc. has an attribute, and it requires a generic value, we have to make sure we support that.
  • Parameter null check - From what I can tell, this isn't required if you're overriding a virtual method, but....the expectation may be that you should put the !! with the parameter name. Also, the generated code itself may want to have !! for the parameters to enforce that they are provided. For example, the self parameter in the generated .Instance() methods.
  • Required members - This isn't available right now in preview mode, but if it's added, when we do an .Instance(), this will be like an init in that you can only set them in an object initializer, but this will be "worse" because I'll have to come up with a way to allow a user to pass in required property values. Maybe allow a passed-in synthesized object instance from something called RequiredPropertyValues, and these would be set in Instance(). Same thing could be done for InitPropertyValues, but that may not work, because you don't have to set them.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions