From: #117997 (comment)
Somewhere in trimDataFlowAnalysis.InterproceduralAnalyze();, an InvalidCastException is thrown due to an attempt to cast NonErrorNamedTypeSymbol to IMethodSymbol.
This is encountered at least for a user-defined compound assignment operator extension:
extension<TScalar>(Tensor<TScalar> tensor)
{
public void operator +=(in ReadOnlyTensorSpan<TScalar> other) => Add(tensor, other, tensor);
public void operator +=(TScalar other) => Add(tensor, other, tensor);
}
I was not able to get a stack trace and root cause exactly where the cast failure was occurring.