Recommend static members for type parameters#53942
Recommend static members for type parameters#53942CyrusNajmabadi merged 5 commits intodotnet:mainfrom
Conversation
| { | ||
| excludeInstance = true; | ||
| excludeStatic = false; | ||
| } |
There was a problem hiding this comment.
i would roll this into the check above. and remove the (INamespaceOrTypeSymbol) cast when assigning to container symbol.
I didn't check the implementation. Note, only static abstract members are valid in this context. So, non-abstract statics probably shouldn't be offered. |
We haven't done any work on VB side yet. It is not clear at this point if we are going to enable this scenario in VB as this would likely require a language spec change. |
It doesn't fail since
Indeed, this seems like a bug I have currently. Will fix it. |
Touche :) |
| interface I1 | ||
| { | ||
|
|
||
| static abstract void M1(); |
| excludeInstance = true; | ||
| excludeStatic = false; | ||
| containerSymbol = (INamespaceOrTypeSymbol)symbol; | ||
| abstractStaticsOnly = symbol.Kind == SymbolKind.TypeParameter; |
There was a problem hiding this comment.
wouldn't this just be abstractsOnly?
| var namedSymbols = excludeStatic | ||
| ? symbols.WhereAsArray(s => !(s.IsStatic || s is ITypeSymbol)) | ||
| : symbols; | ||
| : (abstractStaticsOnly ? symbols.WhereAsArray(s => s.IsAbstract && s.IsStatic) : symbols); |
There was a problem hiding this comment.
shouldn't the static check alreacy have happened because we passed excludeInstance to GetMemberSymbols. so we only need to check abstracts here, right?
|
The feature branch has been merged into 'main', this PR should be retargeted to 'main' |
|
Thanks! |
@AlekseyTs What's the situation for consuming interfaces with statics in VB? i.e, Anything needed for VB completion?
Fixes #53930