我在一些 C# 源代码中发现了以下行:
if(!(context.Compilation.GetTypeByMetadataName("Xunit.FactAttribute") is { } factAttribute))
这是另一个:
if(!(diagnostic.Location.SourceTree is { } tree))
运算符{ }后面的花括号 ( )是什么意思is?
{ }
is
c# curly-braces operator-keyword
c# ×1
curly-braces ×1
operator-keyword ×1