Prefer types over members in attribute arguments #9785
Unanswered
xparadoxical
asked this question in
General
Replies: 1 comment
-
This is not true. It's fine to bind to non-static things. That happens in attributes all the time. For example: [Attr(nameof(param)]
void Foo(int param) {} |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Incorrect binding to a property instead of type when property is nullable roslyn#80904
It makes no sense to bind to a property here, and the resulting error prevents using an enum constant like you'd normally be able to do.
The error: CS0236 is reported incorrectly on a nullable enum property with same name as enum type. roslyn#56348
That's a somewhat similar case, but in a property initializer it's absolutely valid to use a property.
Beta Was this translation helpful? Give feedback.
All reactions