You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that all four cases should be okay, but in fact, Roslyn throws a syntax error CS0826 (No best type found for implicitly-typed array) for the new expression of z1 . The reason why I think z1 is okay is that A is a struct, so new[] means new A[] as the only possibility. Therefore, the inner expression new() should stand for new A().
The text was updated successfully, but these errors were encountered:
Consider the code in C# 9:
I think that all four cases should be okay, but in fact, Roslyn throws a syntax error CS0826 (No best type found for implicitly-typed array) for the new expression of
z1
. The reason why I thinkz1
is okay is thatA
is astruct
, sonew[]
meansnew A[]
as the only possibility. Therefore, the inner expressionnew()
should stand fornew A()
.The text was updated successfully, but these errors were encountered: