Syntax is not supposed to convey semantic information. We should avoid doing analysis based on that.
Instead we should store this information in the initial bound tree.
public override BoundNode? VisitArrayCreation(BoundArrayCreation node)
{
...
bool isInferred = node.Syntax.Kind() == SyntaxKind.ImplicitArrayCreationExpression;
...
}
private BoundNode? VisitStackAllocArrayCreationBase(BoundStackAllocArrayCreationBase node)
{
...
bool isInferred = node.Syntax.Kind() == SyntaxKind.ImplicitStackAllocArrayCreationExpression;
...
}
Syntax is not supposed to convey semantic information. We should avoid doing analysis based on that.
Instead we should store this information in the initial bound tree.