-
-
- typeof expression. A generic type is considered unbound
- if all of the type argument lists in its fully qualified name are empty.
- Note that the type arguments of an unbound generic type will be returned as error
- types because they do not really have type arguments. An unbound generic type
- yields null for its BaseType and an empty result for its Interfaces.
-
- 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); --
- using (var localVariable = new StreamReader("C:\\Temp\\MyFile.txt")) { ... }
-
-
- { A=true, B=false, C=new int[3] { 1, 2, 3 } }
-
-
- Inline == true:
-
- {
- A: true,
- B: false,
- C: new int[3] { 1, 2, 3 }
- }
-
-
- class B{T} where T : A // B depends on A by rule #2
- class A : B{A} // A depends on B by rule #1
-
-
-
- public class E
- {
- public struct N2
- {
- public N3 n1; // E.N2 depends on E.N3 by rule #3 and thus on E by rule #5
- }
- public struct N3
- {
- }
- N2 n2; // E depends on E.N2 by rule #3
- }
-
-
- methDef = method.Module.ResolveMethod(
- method.MetadataToken,
- method.DeclaringType != null ? method.DeclaringType.GetGenericArguments() : null,
- null);
-
- and to force call to GetMemberRefToken in GetMethodTokenInternal. Calling GetMethodTokenInternal produces incorrect token for
- a reference to a method on a baked type in a dynamic assembly (the modules are compared equal). Method gf{T} in test CompilationChain_Ldftn.
-
- if (!this.Equals(methodInfoUnbound.Module)
- || (methodInfoUnbound.DeclaringType != null AndAlso methodInfoUnbound.DeclaringType.IsGenericType))
- {
- tk = GetMemberRefToken(methodInfoUnbound, null);
- }
- else
- {
- tk = GetMethodTokenInternal(methodInfoUnbound).Token;
- }
-
- System.Console.WriteLine();
- and if the statement is an expression statement of type void e.g,
- System.Console.WriteLine(). However,
- #line (C#) or #ExternalSource (VB) directives.
- #line in C# or #ExternalSource in VB).
- #line).
- #line in C# or #ExternalSource in VB).
- #line,
- otherwise it's #line directive that preceeds it and that
- either specifies an explicit file path or is #line default exists and specifies an explicit path.
-
- if (reader.StringComparer.Equals(typeDef.Namespace, "System") &&
- reader.StringComparer.Equals(typeDef.Name, "Object")
- {
- // found System.Object
- }
-
-
- is no less efficient than:
-
-
- var comparer = reader.StringComparer;
- if (comparer.Equals(typeDef.Namespace, "System") &&
- comparer.Equals(typeDef.Name, "Object")
- {
- // found System.Object
- }
-
-
- The choice between them is therefore one of style and not performance.
-