3 writes to Compilation
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder.cs (3)
34this.Compilation = compilation; 42this.Compilation = next.Compilation; 55this.Compilation = next.Compilation;
316 references to Compilation
Microsoft.CodeAnalysis.CSharp (311)
Binder\Binder.cs (8)
42this.Compilation = next.Compilation; 55this.Compilation = next.Compilation; 137return result == OverflowChecks.Enabled || result == OverflowChecks.Implicit && Compilation.Options.CheckOverflow; 159internal bool UseUpdatedEscapeRules => Compilation.SourceModule.UseUpdatedEscapeRules; 264!csTree.IsGeneratedCode(this.Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None), 283switch (Compilation.Options.NullableContextOptions) 294throw ExceptionUtilities.UnexpectedValue(Compilation.Options.NullableContextOptions); 830return new CompoundUseSiteInfo<AssemblySymbol>(futureDestination, Compilation.Assembly);
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
183enclosingBinder.Compilation,
Binder\Binder.ValueChecks.cs (3)
779Compilation.GetWellKnownType(WellKnownType.System_Range), 1209(Compilation.FeatureStrictEnabled 1536if (setMethod.DeclaringCompilation != this.Compilation)
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
90new ExtendedErrorTypeSymbol(this.Compilation, "", 0, info));
Binder\Binder_AnonymousTypes.cs (1)
105AnonymousTypeManager manager = this.Compilation.AnonymousTypeManager;
Binder\Binder_Attributes.cs (6)
392if (!paramType.Type.IsValidAttributeParameterType(Compilation)) 519if (setMethod.IsInitOnly && setMethod.DeclaringCompilation != this.Compilation) 651if (!namedArgumentType.IsValidAttributeParameterType(Compilation)) 935var typedConstantKind = node.Type.GetAttributeParameterTypedConstantKind(_binder.Compilation); 992var typedConstantKind = operandType.GetAttributeParameterTypedConstantKind(_binder.Compilation); 1047var typedConstantKind = type.GetAttributeParameterTypedConstantKind(_binder.Compilation);
Binder\Binder_Await.cs (1)
40TypeSymbol awaitExpressionType = info.GetResult?.ReturnType ?? (hasErrors ? CreateErrorType() : Compilation.DynamicType);
Binder\Binder_Conversions.cs (8)
322if (Compilation.SourceModule != method.ContainingModule) 326if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces) 334Compilation.SourceModule != method.ContainingModule) 433if (targetTyped && !destination.IsErrorType() && !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureTargetTypedConditional)) 438Compilation.LanguageVersion.ToDisplayString(), 658delegateType = Compilation.GetWellKnownType(WellKnownType.System_Linq_Expressions_Expression_T).Construct(delegateType); 881stackAllocType = Compilation.GetWellKnownType(WellKnownType.System_Span_T).Construct(elementType); 1097return !methodSymbol.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, node.Location, diagnostics));
Binder\Binder_Crefs.cs (2)
961Debug.Assert(!this.Compilation.ContainsSyntaxTree(typeSyntax.SyntaxTree) || 962this.Compilation.GetBinderFactory(typeSyntax.SyntaxTree).GetBinder(typeSyntax).Flags ==
Binder\Binder_Deconstruct.cs (6)
46.CheckFeatureAvailability(diagnostics, Compilation, node.Location); 55.CheckFeatureAvailability(diagnostics, Compilation, node.Location); 329GenerateImplicitConversionError(diagnostics, Compilation, single.Syntax, nestedConversion, tupleOrDeconstructedTypes[i], single.Type); 537compilation: Compilation, 580bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 585tupleNames, this.Compilation,
Binder\Binder_Expressions.cs (51)
224return new ExtendedErrorTypeSymbol(this.Compilation, name, arity: 0, errorInfo: null, unreported: false); 316SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, trueSymbol, falseSymbol); 938bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 947Compilation, 1026bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 1029this.Compilation, syntax: node, diagnostics: diagnostics, shouldCheckConstraints: true, 1034NamedTypeSymbol.VerifyTupleTypePresent(elements.Length, node, this.Compilation, diagnostics); 1184TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference); 1232TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference); 1393bool typeHasErrors = type.IsErrorType() || CheckManagedAddr(Compilation, type, node.Location, diagnostics); 1813this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true); 1876this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true); 1892this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true); 2135TypeSymbol hostObjectType = Compilation.GetHostObjectTypeSymbol(); 2554SymbolDistinguisher distinguisher1 = new SymbolDistinguisher(this.Compilation, operand.Type, targetType); 2624SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, operand.Type, targetType); 2797if (Compilation.FeatureStrictEnabled || !isDelegateCreation) 3115if (!hadLangVersionError && !Compilation.LanguageVersion.AllowNonTrailingNamedArguments()) 3430var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank); 3452CheckManagedAddr(Compilation, bestType, node.Location, diagnostics, errorForManaged: true); 3664this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)), 3810hasErrors = hasErrors || CheckManagedAddr(Compilation, elementType.Type, elementTypeSyntax.Location, diagnostics, errorForManaged: true); 3872if (requiredVersion > Compilation.LanguageVersion) 5626Debug.Assert((object)this.Compilation.Assembly != null); 5627return IsSymbolAccessibleConditional(constructor, this.Compilation.Assembly, ref useSiteInfo); 5891SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, coClassType, interfaceType); 6509type: Compilation.DynamicType, 6809Compilation.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion()) 7035TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncAction), TypeCompareKind.ConsiderEverything2) || 7036TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncActionWithProgress_T), TypeCompareKind.ConsiderEverything2) || 7037TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperation_T), TypeCompareKind.ConsiderEverything2) || 7038TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperationWithProgress_T2), TypeCompareKind.ConsiderEverything2); 7299if ((object)methodGroup.Methods[i].ReduceExtensionMethod(left.Type, this.Compilation) == null) 7522if ((object)Compilation.SourceModule != fieldSymbol.OriginalDefinition.ContainingModule && 7526if (!Compilation.Assembly.RuntimeSupportsByRefFields) 7628if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces && Compilation.SourceModule != symbol.ContainingModule) 7635if (!Compilation.Assembly.RuntimeSupportsDefaultInterfaceImplementation && Compilation.SourceModule != symbol.ContainingModule) 8544TypeSymbol.Equals(argType, Compilation.GetWellKnownType(WellKnownType.System_Index), TypeCompareKind.ConsiderEverything) ? ThreeState.True : 8545TypeSymbol.Equals(argType, Compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything) ? ThreeState.False : 8677var intPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 8752var startArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 8753var lengthArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 9140if (m.ReduceExtensionMethod(receiver.Type, Compilation) is { } reduced && 9241var delegateType = Compilation.GetWellKnownType(wkDelegateType); 9246if (checkConstraints(Compilation, Conversions, delegateType, typeArguments)) 9272return Compilation.AnonymousTypeManager.ConstructAnonymousDelegateSymbol(typeDescr); 9388resultIsUsed = (((SimpleLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation); 9392resultIsUsed = (((ParenthesizedLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation); 9396resultIsUsed = (((ArrowExpressionClauseSyntax)parent).Expression != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
Binder\Binder_Initializers.cs (1)
254if (binder.Compilation.IsSubmission)
Binder\Binder_InterpolatedString.cs (8)
32if (startText.StartsWith("@$\"") && !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureAltInterpolatedVerbatimStrings)) 53var newLinesInInterpolationsAllowed = this.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNewLinesInInterpolations); 85this.Compilation.LanguageVersion.ToDisplayString(), 281var interpolatedStringHandlerType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler); 312var interpolatedStringHandlerType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler); 518else if (!Compilation.IsFeatureEnabled(MessageID.IDS_FeatureImprovedInterpolatedStrings) && diagnostics.AccumulatesDiagnostics) 830var expected = builderPatternExpectsBool == true ? Compilation.GetSpecialType(SpecialType.System_Boolean) : Compilation.GetSpecialType(SpecialType.System_Void);
Binder\Binder_Invocation.cs (17)
299CheckRestrictedTypeReceiver(result, this.Compilation, diagnostics); 394type: Compilation.DynamicType, 405if (!Compilation.LanguageVersion.AllowNonTrailingNamedArguments()) 834(typeArgumentsOpt.IsDefault || ((MethodSymbol)(object)result.Member).CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, syntax.Location, candidateDiagnostics)))) 1194if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_UnknownWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol) 1203if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_DispatchWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol) 1212if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Type__Missing, diagnostics, syntax: syntax) is FieldSymbol fieldSymbol) 1377defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 1381string path = callerSourceLocation.SourceTree.GetDisplayPath(callerSourceLocation.SourceSpan, Compilation.Options.SourceReferenceResolver); 1382defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1387defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1391&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).Exists 1396defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1418TypeSymbol constantType = Compilation.GetSpecialType(defaultConstantValue.SpecialType); 1620var returnType = GetCommonTypeOrReturnType(methods) ?? new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null); 1836TypeSymbol returnType = new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null); 1911return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
Binder\Binder_Lambda.cs (3)
190ReportUseSiteDiagnosticForSynthesizedAttribute(Compilation, 385bool allowShadowingNames = binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNameShadowingInNestedFunctions); 405binder.Compilation,
Binder\Binder_Lookup.cs (28)
262bool isSubmissionTree = Compilation.IsSubmissionSyntaxTree(declarationSyntax.SyntaxTree); 265for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission) 269var isCurrentSubmission = submission == Compilation; 283submissionImports = ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetImports(declarationSyntax, basesBeingResolved); 317submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation); 393Compilation.MarkImportDirectiveAsUsed(directive); 714if (Compilation.IsEqualOrDerivedFromWellKnownClass(namedType, WellKnownType.System_Attribute, ref useSiteInfo)) 840var error = new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagInfo, unreported: true); 852currentType = currentType.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, this.Compilation, ref visited); 959idictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IDictionary_KV); 960iroDictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IReadOnlyDictionary_KV); 961iListSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_IList); 962iCollectionSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_ICollection); 963inccSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Specialized_INotifyCollectionChanged); 964inpcSymbol = Compilation.GetWellKnownType(WellKnownType.System_ComponentModel_INotifyPropertyChanged); 1161this.LookupMembersInClass(tmp, this.Compilation.GetSpecialType(SpecialType.System_Object), name, arity, basesBeingResolved, options, originalBinder, type, diagnose, ref useSiteInfo); 1253if (!IsDerivedType(baseType: hiddenContainer, derivedType: hidingSym.ContainingType, basesBeingResolved, this.Compilation, useSiteInfo: ref useSiteInfo) && 1350if ((object)symbol.DeclaringCompilation != this.Compilation 1407else if (!this.Compilation.SourceModule.Equals(unwrappedSymbol.ContainingModule) && unwrappedSymbol.IsHiddenByCodeAnalysisEmbeddedAttribute()) 1462diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_FriendRefNotEqualToThis, unwrappedSymbol.ContainingAssembly.Identity.ToString(), AssemblyIdentity.PublicKeyToString(this.Compilation.Assembly.PublicKey)); 1510var assemblyName = this.Compilation.AssemblyName; 1521ImmutableArray<byte> publicKey = this.Compilation.Assembly.PublicKey; 1647return !IsEffectivelyPrivate(symbol) || symbol.ContainingAssembly == this.Compilation.Assembly; 1891for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission) 1898bool isCurrentSubmission = submission == Compilation; 1906submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation); 2012type = type.GetNextBaseTypeNoUseSiteDiagnostics(null, this.Compilation, ref visited); 2029this.AddMemberLookupSymbolsInfoInClass(result, Compilation.GetSpecialType(SpecialType.System_Object), options, originalBinder, accessThroughType);
Binder\Binder_NameConflicts.cs (1)
103bool allowShadowing = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNameShadowingInNestedFunctions);
Binder\Binder_Operators.cs (14)
64var finalDynamicConversion = this.Compilation.Conversions.ClassifyConversionFromExpression(placeholder, left.Type, isChecked: CheckOverflowAtRuntime, ref useSiteInfo); 77Compilation.DynamicType), 292if (!eventSymbol.OriginalDefinition.IsFromCompilation(this.Compilation)) 419type: Compilation.DynamicType, 851return type is NamedTypeSymbol namedType && Compilation.IsReadOnlySpanType(namedType) && 1035var booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean); 1348operatorMethod.ContainingModule != Compilation.SourceModule) 2363if (Compilation.SourceModule != methodOpt.ContainingModule) 2367if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces) 2391if (Compilation.SourceModule != methodOpt.ContainingModule) 2509hasErrors = CheckManagedAddr(Compilation, operandType, managedKind, node.Location, diagnostics); 3754bool hasErrors = ReportAsOperatorConversionDiagnostics(node, diagnostics, this.Compilation, operandType, targetType, conversion.Kind, operand.ConstantValueOpt); 4364if (Compilation.Assembly.RuntimeSupportsNumericIntPtr) 4380if (Compilation.Assembly.RuntimeSupportsNumericIntPtr)
Binder\Binder_Patterns.cs (17)
59this.Compilation, pattern.Syntax, expression, innerPattern, whenTrueLabel: whenTrueLabel, whenFalseLabel: whenFalseLabel, diagnostics); 363hasErrors |= !TryGetSpecialTypeMember(Compilation, SpecialMember.System_Array__Length, node, diagnostics, out PropertySymbol lengthProperty); 623if (Compilation.LanguageVersion < requiredVersion && !patternExpressionConversion.IsImplicit) 645if (MessageID.IDS_FeatureSpanCharConstantPattern.CheckFeatureAvailability(diagnostics, Compilation, node.Location)) 765if (requiredVersion > Compilation.LanguageVersion) 769Compilation.LanguageVersion.ToDisplayString(), 1105var objectType = Compilation.GetSpecialType(SpecialType.System_Object); 1132var objectType = Compilation.GetSpecialType(SpecialType.System_Object); 1237if (Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion()) 1242iTupleType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_ITuple); 1251if (declType != (object)Compilation.GetSpecialType(SpecialType.System_Object) && 1252declType != (object)Compilation.DynamicType && 1260iTupleGetLength = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Length); 1261iTupleGetItem = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Item); 1278var result = Compilation.Conversions.ClassifyBuiltInConversion(type, possibleBaseInterface, isChecked: CheckOverflowAtRuntime, ref useSiteInfo).IsImplicit; 1315|| (inputType.IsPointerType() && Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())) 1348var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
Binder\Binder_Query.cs (1)
812AnonymousTypeManager manager = this.Compilation.AnonymousTypeManager;
Binder\Binder_QueryErrors.cs (4)
89var ienumerable_t = Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T); 90var iqueryable_t = Compilation.GetWellKnownType(WellKnownType.System_Linq_IQueryable_T); 127var ienumerable = Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable); 128var iqueryable = Compilation.GetWellKnownType(WellKnownType.System_Linq_IQueryable);
Binder\Binder_Statements.cs (16)
173if (!this.Compilation.Options.AllowUnsafe) 393if (Compilation.LanguageVersion < MessageID.IDS_FeatureSwitchExpression.RequiredVersion()) 410if ((object)type == null || !type.IsErrorType() && !Compilation.IsExceptionType(type.EffectiveType(ref useSiteInfo), ref useSiteInfo)) 636return method.ReturnsVoid || method.IsIterator || method.IsAsyncEffectivelyReturningTask(this.Compilation); 1319if (CheckManagedAddr(Compilation, elementType, initializerSyntax.Location, diagnostics)) 1384GenerateImplicitConversionError(diagnostics, this.Compilation, initializerSyntax, elementConversionClassification, pointerType, declType); 2157SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, lambdaParameterType, delegateParameterType); 2396GenerateImplicitConversionError(diagnostics, this.Compilation, syntax, conversion, sourceType, targetType, operand.ConstantValueOpt); 2844return symbol?.Kind == SymbolKind.Method && ((MethodSymbol)symbol).IsAsyncEffectivelyReturningTask(this.Compilation); 2850return symbol?.Kind == SymbolKind.Method && ((MethodSymbol)symbol).IsAsyncEffectivelyReturningGenericTask(this.Compilation); 2859return method.IsAsyncReturningIAsyncEnumerable(this.Compilation) || 2860method.IsAsyncReturningIAsyncEnumerator(this.Compilation); 3159if (!Compilation.IsExceptionType(effectiveType, ref useSiteInfo)) 3212else if (TypeSymbol.Equals(previousType, Compilation.GetWellKnownType(WellKnownType.System_Exception), TypeCompareKind.ConsiderEverything2) && 3213Compilation.SourceAssembly.RuntimeCompatibilityWrapNonExceptionThrows) 3683initializerInvocation = BindImplicitConstructorInitializer((MethodSymbol)this.ContainingMember(), diagnostics, Compilation);
Binder\Binder_Symbols.cs (37)
348return symbol.ContainingNamespaceOrType() ?? this.Compilation.Assembly.GlobalNamespace; 355return this.Compilation.GlobalNamespaceAlias; 542TypeWithAnnotations constructedType = typeArgument.SetIsAnnotated(Compilation); 548diagnostics.Add(new LazyUseSiteDiagnosticsInfoForNullableType(Compilation.LanguageVersion, constructedType), syntax.GetLocation()); 555type.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: true, location, diagnostics)); 557else if (GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(Compilation.LanguageVersion, constructedType) is { } diagnosticInfo) 596CheckManagedAddr(Compilation, elementType.Type, node.Location, diagnostics); 667var array = ArrayTypeSymbol.CreateCSharpArray(this.Compilation.Assembly, type, rankSpecifier.Rank); 720ReportMissingTupleElementNamesAttributesIfNeeded(Compilation, syntax.GetLocation(), diagnostics); 731bool includeNullability = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNullableReferenceTypes); 738this.Compilation, 832return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(qualifierOpt ?? this.Compilation.Assembly.GlobalNamespace, string.Empty, arity: 0, errorInfo: null)); 859Compilation.Assembly.GlobalNamespace, identifierValueText, 0, 887bindingResult = Compilation.DynamicType; 916if (Compilation.IsFeatureEnabled(MessageID.IDS_FeatureUsingTypeAlias) ? type.ContainsPointer() : type.IsUnsafe()) 929if (Compilation.LanguageVersion < MessageID.IDS_FeatureDynamic.RequiredVersion()) 1041if (!Compilation.HasDynamicEmitAttributes(bag, node.Location)) 1329return new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagnosticInfo, unreported: false); 1356var binder = !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureUsingTypeAlias) 1564bool includeNullability = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNullableReferenceTypes); 1565type.CheckConstraintsForNamedType(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability, typeSyntax.Location, diagnostics), 1634return GetSpecialType(this.Compilation, typeId, node, diagnostics); 1660return TryGetSpecialTypeMember(this.Compilation, member, syntax, diagnostics, out memberSymbol) 1738return GetWellKnownType(this.Compilation, type, diagnostics, location); 1764NamedTypeSymbol typeSymbol = this.Compilation.GetWellKnownType(type); 1772return GetWellKnownTypeMember(Compilation, member, diagnostics, location, syntax, isOptional); 1877if (container is object && container != Compilation.Assembly && container != Compilation.Assembly.CorLibrary) 2102if (ns.ContainingAssembly == Compilation.Assembly) 2114Debug.Assert(arg2.ContainingAssembly == Compilation.Assembly); 2157Compilation.IsAttributeType((NamedTypeSymbol)first) && 2158Compilation.IsAttributeType((NamedTypeSymbol)second)) 2216((SourceModuleSymbol)this.Compilation.SourceModule).AnyReferencedAssembliesAreLinked) 2271return new ExtendedErrorTypeSymbol(qualifierOpt ?? Compilation.Assembly.GlobalNamespace, simpleName, arity, info); 2433var compilation = this.Compilation; 2534if (ReferenceEquals(qualifierOpt, Compilation.GlobalNamespace)) 2591Compilation.Assembly.Modules[0].GetReferencedAssemblySymbols())
Binder\Binder_TupleOperators.cs (2)
194TypeSymbol dynamicType = hasError ? CreateErrorType() : Compilation.DynamicType; 243var compilation = this.Compilation;
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
889container = outer.Compilation.GlobalNamespace; 897outer = AddInImportsBinders((SourceNamespaceSymbol)outer.Compilation.SourceModule.GetModuleNamespace(ns), namespaceDecl, outer, inUsing);
Binder\BuckStopsHereBinder.cs (1)
70return IsSymbolAccessibleConditional(symbol, Compilation.Assembly, ref useSiteInfo);
Binder\ForEachLoopBinder.cs (14)
227messageId.CheckFeatureAvailability(diagnostics, Compilation, collectionExpr.Syntax.Location); 467SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, inferredType.Type, iterationVariableType.Type); 568IsIEnumerableT(builder.CollectionType.OriginalDefinition, IsAsync, Compilation) || 887this.Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T) : 888this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T)); 905getEnumeratorMethod = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerable_T__GetAsyncEnumerator, 945Debug.Assert(enumeratorType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T))); 955currentPropertyGetter = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__get_Current, diagnostics, errorLocationSyntax.Location, isOptional: false); 1063isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable), 1100TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2)); 1526return type.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T)); 1548NamedTypeSymbol implementedIEnumerable = GetIEnumerableOfT(type, isAsync, Compilation, ref useSiteInfo, out foundMultiple); 1557var implementedNonGeneric = this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable);
Binder\HostObjectModeBinder.cs (1)
24TypeSymbol result = this.Compilation.GetHostObjectTypeSymbol();
Binder\InContainerBinder.cs (2)
48return ((object)merged != null) ? merged.GetConstituentForCompilation(this.Compilation) : _container; 94return TypeWithAnnotations.Create(this.Compilation.GetSpecialType(SpecialType.System_Object));
Binder\InMethodBinder.cs (1)
138var elementType = GetIteratorElementTypeFromReturnType(Compilation, refKind, returnType, errorLocation: null, diagnostics: null);
Binder\InSubmissionClassBinder.cs (3)
41for (var submission = this.Compilation; submission != null; submission = submission.PreviousSubmission) 60internal override ImmutableArray<AliasAndExternAliasDirective> ExternAliases => ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetExternAliases(_declarationSyntax); 62internal override ImmutableArray<AliasAndUsingDirective> UsingAliases => ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetUsingAliases(_declarationSyntax, basesBeingResolved: null);
Binder\LockBinder.cs (2)
46if (expr.ConstantValueOpt != ConstantValue.Null || Compilation.FeatureStrictEnabled) // Dev10 allows the null literal. 52else if (!exprType.IsReferenceType && (exprType.IsValueType || Compilation.FeatureStrictEnabled))
Binder\Semantics\Conversions\Conversions.cs (3)
25: base(binder.Compilation.Assembly.CorLibrary, currentRecursionDepth, includeNullability, otherNullabilityOpt) 36protected override CSharpCompilation Compilation { get { return _binder.Compilation; } } 158GetDelegateOrFunctionPointerArguments(source.Syntax, analyzedArguments, delegateInvokeMethodOpt.Parameters, binder.Compilation);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
380TypeSymbol systemDelegateType = _binder.Compilation.GetSpecialType(SpecialType.System_Delegate);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
293binder.Compilation, 1394Conversions.GetDelegateOrFunctionPointerArguments(source.Syntax, analyzedArguments, delegateParameters, binder.Compilation);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (4)
39get { return _binder.Compilation; } 54bool value = _binder.Compilation.FeatureStrictEnabled; 2458if (_binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureImprovedInterpolatedStrings) && 3584_binder.Compilation,
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
322if (HadConstructedParameterFailedConstraintCheck(binder.Conversions, binder.Compilation, diagnostics, location)) 1273SymbolDistinguisher distinguisher = new SymbolDistinguisher(binder.Compilation, displayArg, UnwrapIfParamsArray(parameter, isLastParameter));
Binder\SwitchBinder_Patterns.cs (1)
46compilation: this.Compilation,
Binder\SwitchExpressionBinder.cs (1)
62decisionDag = DecisionDagBuilder.CreateDecisionDagForSwitchExpression(this.Compilation, node, boundInputExpression, switchArms, defaultLabel, diagnostics);
Binder\UsingStatementBinder.cs (5)
200awaitableType = originalBinder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_ValueTask); 217BindingDiagnosticBag patternDiagnostics = originalBinder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureDisposalPattern) 223MessageID.IDS_FeatureDisposalPattern.CheckFeatureAvailability(diagnostics, originalBinder.Compilation, syntax.Location); 293? originalBinder.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) 294: originalBinder.Compilation.GetSpecialType(SpecialType.System_IDisposable);
Binder\WithExternAndUsingAliasesBinder.cs (1)
178foreach (var declaration in ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).MergedDeclaration.Declarations)
BoundTree\UnboundLambda.cs (10)
147var compilation = Binder.Compilation; 226var useSiteInfo = withDependencies ? new CompoundUseSiteInfo<AssemblySymbol>(binder.Compilation.Assembly) : CompoundUseSiteInfo<AssemblySymbol>.DiscardedDependencies; 319binder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task); 334binder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T); 723returnType = TypeWithAnnotations.Create(Binder.Compilation.GetSpecialType(SpecialType.System_Void)); 747var compilation = Binder.Compilation; 812if (Binder.MethodOrLambdaRequiresValue(lambdaSymbol, this.Binder.Compilation)) 849Binder.Compilation, 924? TypeWithAnnotations.Create(this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)) 1172? this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)
Compilation\CSharpSemanticModel.cs (3)
4564binder.Compilation); 4579binder.Compilation); 4624binder.Compilation);
Compiler\MethodCompiler.cs (1)
1836var compilation = bodyBinder.Compilation;
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
75var code = tree.IsGeneratedCode(binder.Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None)
FlowAnalysis\NullableWalker.cs (4)
1526binder.Compilation, 1599var compilation = binder.Compilation; 4301var walker = new NullableWalker(binder.Compilation, 4342reportRemainingWarnings: false, reportTopLevelWarnings: false).ToTypeWithAnnotations(binder.Compilation);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
26CallingConvention callingConvention = getCallingConvention(typeBinder.Compilation, syntax.CallingConvention, customModifiers, diagnostics);
Symbols\FunctionTypeSymbol.cs (1)
88if (_binder.Compilation.TestOnlyCompilationData is InferredDelegateTypeData data &&
Symbols\Source\LocalFunctionSymbol.cs (1)
41Debug.Assert(containingSymbol.DeclaringCompilation == binder.Compilation);
Symbols\Source\ParameterHelpers.cs (1)
209bool allowShadowingNames = withTypeParametersBinder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNameShadowingInNestedFunctions) &&
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
76if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error && 77binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
Symbols\Source\SourceLocalSymbol.cs (1)
51Debug.Assert(containingSymbol.DeclaringCompilation == scopeBinder.Compilation);
Symbols\Source\SourceParameterSymbol.cs (1)
52Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(context.Compilation,
Symbols\Symbol_Attributes.cs (1)
843if (!boundAttribute.HasErrors && ValidateAttributeUsage(boundAttribute, attributeSyntax, binder.Compilation, symbolPart, diagnostics, uniqueAttributeTypes))
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (5)
Binders\EEMethodBinder.cs (1)
49_sourceBinder = new InMethodBinder(substitutedSourceMethod, new BuckStopsHereBinder(next.Compilation, associatedFileIdentifier: null).WithAdditionalFlags(BinderFlags.InEEMethodBinder));
Binders\PlaceholderLocalBinder.cs (2)
39var compilation = next.Compilation; 86var local = new ObjectAddressLocalSymbol(_containingMethod, name, this.Compilation.GetSpecialType(SpecialType.System_Object), address);
CompilationContext.cs (2)
717binder.Compilation.GetSpecialType(SpecialType.System_Object)); 967var typeNameDecoder = new EETypeNameDecoder(binder.Compilation, (PEModuleSymbol)substitutedSourceMethod.ContainingModule);