Exclude constant and static fields from record's PrintMembers#47868
Exclude constant and static fields from record's PrintMembers#47868jcouv merged 4 commits intodotnet:masterfrom
Conversation
| if (m.Kind is SymbolKind.Field) | ||
| if (m is SymbolField { IsConst: false }) | ||
| { | ||
| return true; |
There was a problem hiding this comment.
true [](start = 27, length = 4)
We should exclude static fields and properties as well. See sharplab.io.
There was a problem hiding this comment.
I have added a check for IsStatic. I think IsConst should be redundant now because constant fields are implicitly static?
I'm also very interested to know why constants are causing issues given that the generated code looks okay.
|
Thanks for jumping on this. |
|
@cston Thanks for writing these tests! See #47867 (comment) |
|
Corresponding spec update: dotnet/csharplang#3919 |
|
Merged/squashed. Thanks @Youssef1313 ! |
Might fix #47867, will confirm after adding a test.
But: