No easy way to determine if a method is partial. #6956
Labels
0 - Backlog
Area-Compilers
Concept-API
This issue involves adding, removing, clarification, or modification of an API.
Feature Request
Milestone
From my inbox...
How to query if a method is a partial definition or partial implementation?
I’ve tried
PartialDefinitionPart
andPartialImplementationPart
, but it seemsPartialDefinitionPart
always return null, even for Test() above.method.PartialDefinitionPart
returns null if the method itself is the definition.Likewise
PartialImplementationPart
returns null if the method itself is the implementation.There seems to be something missing. There doesn’t seem to be any way to know if a method is partial unless the other part happens to exist. i.e. if I have a partial definition, with no partial implementation,
How would I find out that I’m actually partial?
Well, it is a bit hacky, but you may be able to find this out by
method.CallsAreOmitted(tree) && !method.CallsAreConditionallyOmitted(tree)
. However, it probably makes sense to exposeIsPartialDefinition
.Or, perhaps the simplest change would be to have
PartialDefinitionPart
return itself for the definition part, andPartialImplementationPart
return itself for the implementation part.The text was updated successfully, but these errors were encountered: