namespace NS { using o = System.Object; partial class C : o {} partial class C : object {} partial class C : System.Object {} }all three declarations for class C are equivalent and result in the same symbol table object for C. However, these using alias symbols do appear in the results of certain SemanticModel APIs. Specifically, for the base clause of the first of C's class declarations, the following APIs may produce a result that contains an AliasSymbol:
SemanticInfo SemanticModel.GetSemanticInfo(ExpressionSyntax expression); SemanticInfo SemanticModel.BindExpression(CSharpSyntaxNode location, ExpressionSyntax expression); SemanticInfo SemanticModel.BindType(CSharpSyntaxNode location, ExpressionSyntax type); SemanticInfo SemanticModel.BindNamespaceOrType(CSharpSyntaxNode location, ExpressionSyntax type);Also, the following are affected if container==null (and, for the latter, when arity==null or arity==0):
IList<string> SemanticModel.LookupNames(CSharpSyntaxNode location, NamespaceOrTypeSymbol container = null, LookupOptions options = LookupOptions.Default, List<string> result = null); IList<Symbol> SemanticModel.LookupSymbols(CSharpSyntaxNode location, NamespaceOrTypeSymbol container = null, string name = null, int? arity = null, LookupOptions options = LookupOptions.Default, List<Symbol> results = null);
(int x, int y) M() { ... }
will be encoded using an attribute on the return type as follows
[return: TupleElementNamesAttribute(new[] { "x", "y" })]
System.ValueTuple<int, int> M() { ... }
class C : BaseType<((int e1, int e2) e3, int e4)< { ... }
becomes
[TupleElementNamesAttribute(new[] { "e3", "e4", "e1", "e2" });
class C : BaseType<System.ValueTuple<
System.ValueTuple<int,int>, int>
{ ... }
using (var localVariable = new StreamReader("C:\\Temp\\MyFile.txt")) { ... }
sealed class <>z__ReadOnlySingleElementList<T> { private readonly T _item; }
sealed class <>z__ReadOnlyArray<T> { private readonly T[] _items; }
sealed class <>z__ReadOnlyList<T> { private readonly List<T> _items; }
sealed class <>z__ReadOnlySingleElementList<T> { private readonly T _item; }
sealed class <>z__ReadOnlyArray<T> { private readonly T[] _items; }
sealed class <>z__ReadOnlyList<T> { private readonly List<T> _items; }
[InlineArray(N)] struct <>y__InlineArrayN<T> { private T _element0; }
class A // Index 0
{
class B // Index 1
{
}
}
class C // Index 2
{
}
[[prologue]]
try
{
[[method body]]
}
finally
{
[[epilogue]]
}
The prologue is:
var $context = LocalStateTracker.LogXyzEntry($ids);
Where Xyz is a combination of
$context.LogReturn();
2) using T x = expr, y = expr;
)
The node that declares the resource storage, e.g. x = expr
in using T x = expr, y = expr;
.
using T x = expr, y = expr;
)
The node that declares the resource storage, e.g. x = expr
in using T x = expr, y = expr;
.
attribute-list* ('async' | 'static')* type? ('(' | identifier) ...
For better error recovery 'static =>' is also considered a possible lambda expression.
default(Result)
will result in undefined behavior.