413 references to CustomModifiers
Microsoft.CodeAnalysis.CSharp (163)
Binder\Binder_Symbols.cs (1)
1625return type.WithTypeAndModifiers(namedTypeRight.AsUnboundGenericType(), type.CustomModifiers);
Binder\Semantics\Conversions\Conversions.cs (1)
320TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Object), customModifiers: parameter.TypeWithAnnotations.CustomModifiers), parameter.RefCustomModifiers, parameter.IsParams, parameter.RefKind);
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (20)
369var otherModifiers = VisitCustomModifiers(symbol.ElementTypeWithAnnotations.CustomModifiers); 517return t.WithTypeAndModifiers(newType, v.VisitCustomModifiers(t.CustomModifiers)); 595var otherModifiers = VisitCustomModifiers(symbol.PointedAtTypeWithAnnotations.CustomModifiers); 610var otherReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(otherReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 631otherParamsBuilder.Add(param.TypeWithAnnotations.WithTypeAndModifiers(otherType, VisitCustomModifiers(param.TypeWithAnnotations.CustomModifiers))); 735var otherType = type.WithTypeAndModifiers((TypeSymbol?)this.Visit(type.Type), this.VisitCustomModifiers(type.CustomModifiers)); 778Debug.Assert(type.ElementTypeWithAnnotations.CustomModifiers.IsEmpty); 779Debug.Assert(other.ElementTypeWithAnnotations.CustomModifiers.IsEmpty); 832Debug.Assert(type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 833Debug.Assert(other.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 868Debug.Assert(type.PointedAtTypeWithAnnotations.CustomModifiers.IsEmpty); 869Debug.Assert(other.PointedAtTypeWithAnnotations.CustomModifiers.IsEmpty); 900Debug.Assert(type.CustomModifiers.IsEmpty); 942Debug.Assert(type.CustomModifiers.IsDefaultOrEmpty); 943Debug.Assert(other.CustomModifiers.IsDefaultOrEmpty); 1062var translatedModifiers = VisitCustomModifiers(symbol.ElementTypeWithAnnotations.CustomModifiers); 1084v.VisitCustomModifiers(t.CustomModifiers)), 1105var translatedModifiers = VisitCustomModifiers(symbol.PointedAtTypeWithAnnotations.CustomModifiers); 1113var translatedReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(translatedReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 1127translatedParamsBuilder.Add(param.TypeWithAnnotations.WithTypeAndModifiers(translatedParamType, VisitCustomModifiers(param.TypeWithAnnotations.CustomModifiers)));
Emitter\Model\ArrayTypeSymbolAdapter.cs (2)
29if (elementType.CustomModifiers.Length == 0) 35return new Cci.ModifiedTypeReference(type, ImmutableArray<Cci.ICustomModifier>.CastUp(elementType.CustomModifiers));
Emitter\Model\FieldSymbolAdapter.cs (1)
33var customModifiers = fieldTypeWithAnnotations.CustomModifiers;
Emitter\Model\GenericMethodInstanceReference.cs (1)
36Debug.Assert(arg.CustomModifiers.IsEmpty);
Emitter\Model\GenericTypeInstanceReference.cs (1)
30Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any()));
Emitter\Model\MethodReference.cs (1)
97return ImmutableArray<Cci.ICustomModifier>.CastUp(UnderlyingMethod.ReturnTypeWithAnnotations.CustomModifiers);
Emitter\Model\MethodSymbolAdapter.cs (2)
225return ImmutableArray<Cci.ICustomModifier>.CastUp(AdaptedMethodSymbol.ReturnTypeWithAnnotations.CustomModifiers); 260Debug.Assert(arg.CustomModifiers.IsEmpty);
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
866var modifiers = arguments[i].CustomModifiers;
Emitter\Model\ParameterSymbolAdapter.cs (1)
30return ImmutableArray<Cci.ICustomModifier>.CastUp(AdaptedParameterSymbol.TypeWithAnnotations.CustomModifiers);
Emitter\Model\ParameterTypeInformation.cs (1)
31return ImmutableArray<Cci.ICustomModifier>.CastUp(_underlyingParameter.TypeWithAnnotations.CustomModifiers);
Emitter\Model\PointerTypeSymbolAdapter.cs (2)
25if (AdaptedPointerTypeSymbol.PointedAtTypeWithAnnotations.CustomModifiers.Length == 0) 31return new Cci.ModifiedTypeReference(type, ImmutableArray<Cci.ICustomModifier>.CastUp(AdaptedPointerTypeSymbol.PointedAtTypeWithAnnotations.CustomModifiers));
Emitter\Model\PropertySymbolAdapter.cs (1)
181return AdaptedPropertySymbol.TypeWithAnnotations.CustomModifiers.As<ICustomModifier>();
Emitter\Model\SpecializedFieldReference.cs (1)
64var customModifiers = oldType.CustomModifiers;
Emitter\Model\SpecializedGenericMethodInstanceReference.cs (1)
37Debug.Assert(arg.CustomModifiers.IsEmpty);
Emitter\Model\SpecializedGenericNestedTypeInstanceReference.cs (1)
29Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any()));
Lowering\MethodToClassRewriter.cs (1)
334visitedTypeArgs.Add(typeArg.WithTypeAndModifiers(VisitType(typeArg.Type), typeArg.CustomModifiers));
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
434return underlyingTypeSymbol.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.SelectAsArray(a => a.CustomModifiers);
Symbols\AbstractTypeMap.cs (1)
395return substituted.WithTypeAndModifiers(dynamicEraser.EraseDynamic(substituted.Type), substituted.CustomModifiers);
Symbols\Compilation_WellKnownMembers.cs (3)
921HandleCustomModifiers(((ArrayTypeSymbol)type).ElementTypeWithAnnotations.CustomModifiers.Length, transformFlagsBuilder); 930HandleCustomModifiers(((PointerTypeSymbol)type).PointedAtTypeWithAnnotations.CustomModifiers.Length, transformFlagsBuilder); 996HandleCustomModifiers(twa.CustomModifiers.Length, transformFlagsBuilder);
Symbols\ConstructedNamedTypeSymbol.cs (1)
124if (GetUnificationUseSiteDiagnosticRecursive(ref result, typeArg.CustomModifiers, owner, ref checkedTypes))
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
645var modifiersToSearch = RefKind != RefKind.None ? RefCustomModifiers : ReturnTypeWithAnnotations.CustomModifiers; 668var modifiersToSearch = RefKind != RefKind.None ? RefCustomModifiers : ReturnTypeWithAnnotations.CustomModifiers;
Symbols\MemberSignatureComparer.cs (2)
547(unsubstitutedReturnType1.CustomModifiers.IsEmpty && unsubstitutedReturnType2.CustomModifiers.IsEmpty))
Symbols\MemberSymbolExtensions.cs (4)
205count += methodReturnType.CustomModifiers.Length + method.RefCustomModifiers.Length; 211count += paramType.CustomModifiers.Length + param.RefCustomModifiers.Length; 254count += type.CustomModifiers.Length + property.RefCustomModifiers.Length; 260count += paramType.CustomModifiers.Length + param.RefCustomModifiers.Length;
Symbols\Metadata\PE\DynamicTypeDecoder.cs (7)
289transformedTypeArgsBuilder.Add(typeArg.WithTypeAndModifiers(transformedTypeArg, typeArg.CustomModifiers)); 307if (!HandleCustomModifiers(arrayType.ElementTypeWithAnnotations.CustomModifiers.Length)) 321ArrayTypeSymbol.CreateSZArray(_containingAssembly, arrayType.ElementTypeWithAnnotations.WithTypeAndModifiers(transformedElementType, arrayType.ElementTypeWithAnnotations.CustomModifiers)) : 322ArrayTypeSymbol.CreateMDArray(_containingAssembly, arrayType.ElementTypeWithAnnotations.WithTypeAndModifiers(transformedElementType, arrayType.ElementTypeWithAnnotations.CustomModifiers), arrayType.Rank, arrayType.Sizes, arrayType.LowerBounds); 330if (!HandleCustomModifiers(pointerType.PointedAtTypeWithAnnotations.CustomModifiers.Length)) 343new PointerTypeSymbol(pointerType.PointedAtTypeWithAnnotations.WithTypeAndModifiers(transformedPointedAtType, pointerType.PointedAtTypeWithAnnotations.CustomModifiers)); 402|| !decoder.HandleCustomModifiers(typeWithAnnotations.CustomModifiers.Length))
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (3)
186CustomModifiersMatch(fieldType.CustomModifiers, fieldInfo.CustomModifiers)) 266if (!CustomModifiersMatch(substituted.CustomModifiers, targetParam.CustomModifiers) || 294if (!CustomModifiersMatch(substituted.CustomModifiers, targetReturnParam.CustomModifiers) ||
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
77return type.WithTypeAndModifiers(transformedType, type.CustomModifiers);
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1369ReturnTypeWithAnnotations.CustomModifiers.HasIsExternalInitModifier();
Symbols\Metadata\PE\PEParameterSymbol.cs (2)
295typeWithAnnotations = typeWithAnnotations.WithTypeAndModifiers(typeSymbol, typeWithAnnotations.CustomModifiers); 417refCustomModifiers.NullToEmpty().Length + type.CustomModifiers.Length,
Symbols\Metadata\PE\TupleTypeDecoder.cs (2)
121TypeWithAnnotations.Create(decoded, metadataType.NullableAnnotation, metadataType.CustomModifiers); 346TypeWithAnnotations.Create(decoded, typeWithAnnotations.NullableAnnotation, typeWithAnnotations.CustomModifiers);
Symbols\MethodSymbol.cs (1)
1153AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length + this.RefCustomModifiers.Length, this.RefKind));
Symbols\OverriddenOrHiddenMembersHelpers.cs (3)
669Debug.Assert(!(param.TypeWithAnnotations.CustomModifiers.Any() || param.RefCustomModifiers.Any())); 894return methodReturnType.CustomModifiers.Any() || method.RefCustomModifiers.Any() || 899return propertyType.CustomModifiers.Any() || property.RefCustomModifiers.Any() ||
Symbols\PublicModel\ArrayTypeSymbol.cs (1)
64ImmutableArray<CustomModifier> IArrayTypeSymbol.CustomModifiers => _underlying.ElementTypeWithAnnotations.CustomModifiers;
Symbols\PublicModel\FieldSymbol.cs (1)
55get { return _underlying.TypeWithAnnotations.CustomModifiers; }
Symbols\PublicModel\MethodSymbol.cs (1)
253return _underlying.ReturnTypeWithAnnotations.CustomModifiers;
Symbols\PublicModel\NamedTypeSymbol.cs (1)
96return UnderlyingNamedTypeSymbol.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ordinal].CustomModifiers;
Symbols\PublicModel\ParameterSymbol.cs (1)
43get { return _underlying.TypeWithAnnotations.CustomModifiers; }
Symbols\PublicModel\PointerTypeSymbol.cs (1)
49get { return _underlying.PointedAtTypeWithAnnotations.CustomModifiers; }
Symbols\PublicModel\PropertySymbol.cs (1)
98get { return _underlying.TypeWithAnnotations.CustomModifiers; }
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
190var newModifiers = RetargetModifiers(underlyingType.CustomModifiers, out modifiersHaveChanged);
Symbols\SignatureOnlyMethodSymbol.cs (1)
48Debug.Assert(returnType.IsDefault || isInitOnly == CustomModifierUtils.HasIsExternalInitModifier(returnType.CustomModifiers));
Symbols\SignatureOnlyParameterSymbol.cs (3)
114_type.CustomModifiers.Equals(other._type.CustomModifiers) && 125Hash.CombineValues(_type.CustomModifiers),
Symbols\Source\CustomModifierUtils.cs (4)
60sourceMethodReturnType.CustomModifiers); 131if (sourceParameter.TypeWithAnnotations.CustomModifiers.Any() || sourceParameter.RefCustomModifiers.Any() || 133destinationParameter.TypeWithAnnotations.CustomModifiers.Any() || destinationParameter.RefCustomModifiers.Any() || 145sourceParameter.TypeWithAnnotations.CustomModifiers,
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
403compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length));
Symbols\Source\SourceEventSymbol.cs (2)
325AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length)); 627eventWithCustomModifiers.TypeWithAnnotations.CustomModifiers);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
91Debug.Assert(_lazyReturnType.CustomModifiers.IsEmpty); 153Debug.Assert(_lazyReturnType.CustomModifiers.IsEmpty);
Symbols\Source\SourceParameterSymbolBase.cs (1)
93AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length + this.RefCustomModifiers.Length, this.RefKind));
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
285type.CustomModifiers);
Symbols\Source\SourcePropertySymbolBase.cs (2)
227overriddenPropertyType.CustomModifiers); 1127compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length + RefCustomModifiers.Length, _refKind));
Symbols\SubstitutedParameterSymbol.cs (2)
57if (substituted.CustomModifiers.IsEmpty && 58this._underlyingParameter.TypeWithAnnotations.CustomModifiers.IsEmpty &&
Symbols\Symbol.cs (1)
1093DeriveUseSiteInfoFromCustomModifiers(ref result, type.CustomModifiers, allowedRequiredModifierType);
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
65AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDynamicAttribute(type, typeWithAnnotations.CustomModifiers.Length));
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
153AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length + this.RefCustomModifiers.Length, this.RefKind));
Symbols\TypeSymbolExtensions.cs (3)
738foreach (var customModifier in typeWithAnnotationsOpt.CustomModifiers) 1866typeWithAnnotations = TypeWithAnnotations.Create(type, customModifiers: typeWithAnnotations.CustomModifiers); 1890typeArgumentsBuilder[i] = TypeWithAnnotations.Create(typeArgNormalized, customModifiers: typeWithModifier.CustomModifiers);
Symbols\TypeUnification.cs (32)
34Debug.Assert(substituted1.CustomModifiers.SequenceEqual(substituted2.CustomModifiers)); 92if (TypeSymbol.Equals(t1.Type, t2.Type, TypeCompareKind.CLRSignatureCompareOptions) && t1.CustomModifiers.SequenceEqual(t2.CustomModifiers)) 113if (t2.TypeKind != t1.TypeKind || !t2.CustomModifiers.SequenceEqual(t1.CustomModifiers)) 130if (t2.TypeKind != t1.TypeKind || !t2.CustomModifiers.SequenceEqual(t1.CustomModifiers)) 143if (t2.TypeKind != t1.TypeKind || !t2.CustomModifiers.SequenceEqual(t1.CustomModifiers)) 199if (t1.CustomModifiers.IsDefaultOrEmpty) 205if (t1.CustomModifiers.SequenceEqual(t2.CustomModifiers)) 211if (t1.CustomModifiers.Length < t2.CustomModifiers.Length && 212t1.CustomModifiers.SequenceEqual(t2.CustomModifiers.Take(t1.CustomModifiers.Length))) 216customModifiers: ImmutableArray.Create(t2.CustomModifiers, t1.CustomModifiers.Length, t2.CustomModifiers.Length - t1.CustomModifiers.Length))); 224if (t2.CustomModifiers.IsDefaultOrEmpty) 230if (t2.CustomModifiers.Length < t1.CustomModifiers.Length && 231t2.CustomModifiers.SequenceEqual(t1.CustomModifiers.Take(t2.CustomModifiers.Length))) 235customModifiers: ImmutableArray.Create(t1.CustomModifiers, t2.CustomModifiers.Length, t1.CustomModifiers.Length - t2.CustomModifiers.Length)));
Symbols\TypeWithAnnotations.cs (22)
112return Create(Type, NullableAnnotation.Annotated, CustomModifiers); 122return Create(Type, NullableAnnotation.NotAnnotated, CustomModifiers); 188Debug.Assert(CustomModifiers.IsEmpty); 196return CreateNonLazyType(typeSymbol, NullableAnnotation.Annotated, this.CustomModifiers); 239return Create(type, nullableAnnotation, CustomModifiers); 348!this.CustomModifiers.SequenceEqual(other.CustomModifiers)) 416Symbol.GetUnificationUseSiteDiagnosticRecursive(ref result, this.CustomModifiers, owner, ref checkedTypes); 433var newCustomModifiers = typeMap.SubstituteCustomModifiers(this.CustomModifiers); 440Debug.Assert(newTypeWithModifiers.CustomModifiers.IsEmpty); 444newCustomModifiers == CustomModifiers) 458newCustomModifiers == CustomModifiers) 508newCustomModifiers.Concat(newTypeWithModifiers.CustomModifiers)); 536CustomModifiers.IsEmpty; 543_extensions.WithTypeAndModifiers(this, typeSymbol, CustomModifiers); 667result = result.WithTypeAndModifiers(newTypeSymbol, result.CustomModifiers); 684result = CreateNonLazyType(newTypeSymbol, NullableAnnotation.Oblivious, result.CustomModifiers); 704return CreateNonLazyType(typeSymbol, NullableAnnotation.NotAnnotated, CustomModifiers); 716return CreateNonLazyType(newTypeSymbol, NullableAnnotation.Oblivious, CustomModifiers); 722return WithTypeAndModifiers(newTypeSymbol, CustomModifiers); 936Debug.Assert(underlying.CustomModifiers.IsEmpty); 1028newUnderlying.CustomModifiers.IsEmpty)
Utilities\TypeSymbolExtensions.cs (2)
76=> typeWithAnnotations.CustomModifiers.Length + typeWithAnnotations.Type.CustomModifierCount(); 158=> typeWithAnnotations.CustomModifiers.Any() || typeWithAnnotations.Type.HasCustomModifiers(flagNonDefaultArraySizesOrLowerBounds);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (124)
CodeGen\CodeGenFunctionPointersTests.cs (4)
693var returnModifiers = param.Signature.ReturnTypeWithAnnotations.CustomModifiers; 699var paramModifiers = param.Signature.ParameterTypesWithAnnotations[0].CustomModifiers; 869Assert.Equal(1, returnTypeWithAnnotations.CustomModifiers.Length); 870Assert.Equal(SpecialType.System_Object, returnTypeWithAnnotations.CustomModifiers[0].Modifier.SpecialType);
CodeGen\CodeGenTupleTest.cs (23)
3364Assert.True(mFirst.TypeWithAnnotations.CustomModifiers.IsEmpty); 3382Assert.True(mItem1.TypeWithAnnotations.CustomModifiers.IsEmpty); 4601Assert.True(mItem1.TypeWithAnnotations.CustomModifiers.IsEmpty); 11214Assert.True(m1Tuple.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 11258Assert.True(m1Item1.TypeWithAnnotations.CustomModifiers.IsEmpty); 11279Assert.True(m2Item1.TypeWithAnnotations.CustomModifiers.IsEmpty); 11300Assert.True(m2a2.TypeWithAnnotations.CustomModifiers.IsEmpty); 11503Assert.True(m1Tuple.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 11553Assert.True(m1Item9.TypeWithAnnotations.CustomModifiers.IsEmpty); 11568Assert.True(m2Item9.TypeWithAnnotations.CustomModifiers.IsEmpty); 11585Assert.True(m2i2.TypeWithAnnotations.CustomModifiers.IsEmpty); 11787Assert.True(m3Item8.TypeWithAnnotations.CustomModifiers.IsEmpty); 11980Assert.True(m4Item8.TypeWithAnnotations.CustomModifiers.IsEmpty); 11999Assert.True(m4h4.TypeWithAnnotations.CustomModifiers.IsEmpty); 12228Assert.True(m5Item8.TypeWithAnnotations.CustomModifiers.IsEmpty); 12596Assert.True(m8Item8.TypeWithAnnotations.CustomModifiers.IsEmpty); 12616Assert.True(m8Item1.TypeWithAnnotations.CustomModifiers.IsEmpty); 12761Assert.True(m1Tuple.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 12809Assert.True(m1Item1.TypeWithAnnotations.CustomModifiers.IsEmpty); 12828Assert.True(m2Item1.TypeWithAnnotations.CustomModifiers.IsEmpty); 12847Assert.True(m2a2.TypeWithAnnotations.CustomModifiers.IsEmpty); 15832Assert.True(m1P1.TypeWithAnnotations.CustomModifiers.IsEmpty); 15862Assert.True(m1this.TypeWithAnnotations.CustomModifiers.IsEmpty);
Emit\EditAndContinue\SymbolMatcherTests.cs (4)
201Assert.Equal(1, ((PointerTypeSymbol)member1.Parameters[0].Type).PointedAtTypeWithAnnotations.CustomModifiers.Length); 202Assert.Equal(1, ((ArrayTypeSymbol)member1.ReturnType).ElementTypeWithAnnotations.CustomModifiers.Length); 217Assert.Equal(1, ((PointerTypeSymbol)other.Parameters[0].Type).PointedAtTypeWithAnnotations.CustomModifiers.Length); 218Assert.Equal(1, ((ArrayTypeSymbol)other.ReturnType).ElementTypeWithAnnotations.CustomModifiers.Length);
Emit\EmitCustomModifiers.cs (3)
606Assert.False(parameter.TypeWithAnnotations.CustomModifiers.IsEmpty); 662Assert.False(baseParameter.TypeWithAnnotations.CustomModifiers.IsEmpty); 670Assert.False(derivedParameter.TypeWithAnnotations.CustomModifiers.IsEmpty);
Emit\EmitMetadataTests.cs (3)
555Assert.Equal(0, f1.TypeWithAnnotations.CustomModifiers.Length); 558Assert.Equal(1, f2.TypeWithAnnotations.CustomModifiers.Length); 560CustomModifier mod = f2.TypeWithAnnotations.CustomModifiers[0];
Emit\InAttributeModifierTests.cs (87)
1649Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 1669Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 1690Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 1710Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 1731Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 1752Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 1773Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 1793Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 1814Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 1835Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 1855Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 1875Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 1896Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 1916Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 1938Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 1955Assert.Empty(invokeParameter.TypeWithAnnotations.CustomModifiers); 1959Assert.Empty(beginInvokeParameter.TypeWithAnnotations.CustomModifiers); 1963Assert.Empty(endInvokeParameter.TypeWithAnnotations.CustomModifiers); 1980Assert.Empty(invokeMethod.ReturnTypeWithAnnotations.CustomModifiers); 1984Assert.Empty(endInvokeMethod.ReturnTypeWithAnnotations.CustomModifiers); 2004Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2024Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2044Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2064Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2085Assert.Empty(parameters[0].TypeWithAnnotations.CustomModifiers); 2088Assert.Empty(parameters[1].TypeWithAnnotations.CustomModifiers); 2108Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2495Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2521Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2543Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2568Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2590Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2616Assert.Empty(implicitParameter.TypeWithAnnotations.CustomModifiers); 2623Assert.Empty(explicitParameter.TypeWithAnnotations.CustomModifiers); 2645Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2671Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2693Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2718Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 2740Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 2763Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 2785Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 2808Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 2830Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 2853Assert.Empty(implicitMethod.ReturnTypeWithAnnotations.CustomModifiers); 2875Assert.Empty(implicitMethod.ReturnTypeWithAnnotations.CustomModifiers); 2898Assert.Empty(implicitMethod.ReturnTypeWithAnnotations.CustomModifiers); 2920Assert.Empty(implicitMethod.ReturnTypeWithAnnotations.CustomModifiers); 2943Assert.Empty(implicitMethod.ReturnTypeWithAnnotations.CustomModifiers); 2965Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 2988Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3010Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3034Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3056Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3080Assert.Empty(implicitproperty.TypeWithAnnotations.CustomModifiers); 3102Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3126Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3148Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3172Assert.Empty(property.TypeWithAnnotations.CustomModifiers); 3194Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3220Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3242Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3268Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3290Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3316Assert.Empty(implicitParameter.TypeWithAnnotations.CustomModifiers); 3323Assert.Empty(explicitParameter.TypeWithAnnotations.CustomModifiers); 3345Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3371Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3393Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3419Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3441Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3465Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3487Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3511Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3533Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3557Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3579Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3603Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3625Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3649Assert.Empty(indexer.TypeWithAnnotations.CustomModifiers); 3666Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3699Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 3738Assert.Empty(parameter.TypeWithAnnotations.CustomModifiers); 3780Assert.Empty(method.ReturnTypeWithAnnotations.CustomModifiers); 3828Assert.Empty(interfaceMethod.ReturnTypeWithAnnotations.CustomModifiers); 3833Assert.Empty(classMethod.ReturnTypeWithAnnotations.CustomModifiers); 3857Assert.Empty(parentMethod.ReturnTypeWithAnnotations.CustomModifiers); 3862Assert.Empty(classMethod.ReturnTypeWithAnnotations.CustomModifiers);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (1)
SymbolExtensions.cs (1)
24return method.DeclaringCompilation.GetCustomTypeInfoPayload(method.ReturnType, method.ReturnTypeWithAnnotations.CustomModifiers.Length + method.RefCustomModifiers.Length, RefKind.None);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\InitOnlyMemberTests.cs (5)
1457Assert.Empty(property.GetMethod.ReturnTypeWithAnnotations.CustomModifiers); 1474var modifier = property.SetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single(); 3893Assert.Empty(property0.TypeWithAnnotations.CustomModifiers); 3981Assert.Equal("System.Runtime.CompilerServices.IsExternalInit", property0.TypeWithAnnotations.CustomModifiers.Single().Modifier.ToTestDisplayString()); 4758var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).SetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single();
Semantics\RecordTests.cs (2)
12498AssertEx.Equal(expectedModifiers, returnType.CustomModifiers); 12505AssertEx.Equal(expectedModifiers, parameterType.CustomModifiers);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (118)
Symbols\CustomModifiersTests.cs (5)
306return type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(a => a.CustomModifiers.Any()); 1235Assert.True(test.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.SequenceEqual(test.SetMethod.Parameters.First().TypeWithAnnotations.CustomModifiers)); 1523Assert.Same(compilation1.SourceModule.CorLibrary(), ((CSharpCustomModifier)((NamedTypeSymbol)test.Parameters.First().Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].CustomModifiers.First()).ModifierSymbol.ContainingAssembly); 1532Assert.Same(compilation2.SourceModule.CorLibrary(), ((CSharpCustomModifier)((NamedTypeSymbol)test.Parameters.First().Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].CustomModifiers.First()).ModifierSymbol.ContainingAssembly);
Symbols\Metadata\PE\DynamicTransformsTests.cs (1)
413Assert.Equal(1, f0.TypeWithAnnotations.CustomModifiers.Length);
Symbols\Metadata\PE\LoadCustomModifiers.cs (20)
36Assert.Equal(1, f0.TypeWithAnnotations.CustomModifiers.Length); 38var f0Mod = f0.TypeWithAnnotations.CustomModifiers[0]; 56Assert.Equal(0, m1.ReturnTypeWithAnnotations.CustomModifiers.Length); 58Assert.Equal(1, p1.TypeWithAnnotations.CustomModifiers.Length); 60var p1Mod = p1.TypeWithAnnotations.CustomModifiers[0]; 65Assert.Equal(2, p2.TypeWithAnnotations.CustomModifiers.Length); 67foreach (var p2Mod in p2.TypeWithAnnotations.CustomModifiers) 80Assert.Equal(1, m5.ReturnTypeWithAnnotations.CustomModifiers.Length); 82var m5Mod = m5.ReturnTypeWithAnnotations.CustomModifiers[0]; 86Assert.Equal(0, p5.TypeWithAnnotations.CustomModifiers.Length); 92Assert.Equal(1, p5Type.ElementTypeWithAnnotations.CustomModifiers.Length); 93var p5TypeMod = p5Type.ElementTypeWithAnnotations.CustomModifiers[0]; 98Assert.Equal(0, p6.TypeWithAnnotations.CustomModifiers.Length); 104Assert.Equal(1, p6Type.PointedAtTypeWithAnnotations.CustomModifiers.Length); 105var p6TypeMod = p6Type.PointedAtTypeWithAnnotations.CustomModifiers[0]; 111Assert.Equal(1, m7.ReturnTypeWithAnnotations.CustomModifiers.Length); 113var m7Mod = m7.ReturnTypeWithAnnotations.CustomModifiers[0]; 161var propertyTypeCustomModifier = property.TypeWithAnnotations.CustomModifiers.Single(); 170var arrayPropertyTypeCustomModifiers = arrayPropertyType.ElementTypeWithAnnotations.CustomModifiers.Single(); 271count += field.TypeWithAnnotations.CustomModifiers.Length;
Symbols\Metadata\PE\LoadingFields.cs (7)
61Assert.Equal(0, f1.TypeWithAnnotations.CustomModifiers.Length); 70Assert.Equal(0, f2.TypeWithAnnotations.CustomModifiers.Length); 78Assert.Equal(0, f3.TypeWithAnnotations.CustomModifiers.Length); 86Assert.Equal(0, f4.TypeWithAnnotations.CustomModifiers.Length); 94Assert.Equal(0, f5.TypeWithAnnotations.CustomModifiers.Length); 101Assert.Equal(1, f6.TypeWithAnnotations.CustomModifiers.Length); 103CustomModifier mod = f6.TypeWithAnnotations.CustomModifiers[0];
Symbols\Metadata\PE\LoadingIndexers.cs (4)
727Assert.NotEqual(parameterModoptIndexer.Parameters.Last().TypeWithAnnotations.CustomModifiers.Length, parameterModoptIndexer.GetMethod.Parameters.Last().TypeWithAnnotations.CustomModifiers.Length); 732Assert.NotEqual(returnTypeModoptIndexer.TypeWithAnnotations.CustomModifiers.Length, returnTypeModoptIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Length);
Symbols\Metadata\PE\LoadingMethods.cs (1)
76Assert.Equal(0, localM1_1.TypeWithAnnotations.CustomModifiers.Length);
Symbols\Retargeting\RetargetCustomModifiers.cs (22)
48Assert.Equal(1, f0.TypeWithAnnotations.CustomModifiers.Length); 50var f0Mod = f0.TypeWithAnnotations.CustomModifiers[0]; 67Assert.Equal(0, m1.ReturnTypeWithAnnotations.CustomModifiers.Length); 69Assert.Equal(1, p1.TypeWithAnnotations.CustomModifiers.Length); 71var p1Mod = p1.TypeWithAnnotations.CustomModifiers[0]; 77Assert.Equal(2, p2.TypeWithAnnotations.CustomModifiers.Length); 79foreach (var p2Mod in p2.TypeWithAnnotations.CustomModifiers) 87Assert.Equal(1, m5.ReturnTypeWithAnnotations.CustomModifiers.Length); 89var m5Mod = m5.ReturnTypeWithAnnotations.CustomModifiers[0]; 94Assert.Equal(0, p5.TypeWithAnnotations.CustomModifiers.Length); 100Assert.Equal(1, p5Type.ElementTypeWithAnnotations.CustomModifiers.Length); 101var p5TypeMod = p5Type.ElementTypeWithAnnotations.CustomModifiers[0]; 107Assert.Equal(0, p6.TypeWithAnnotations.CustomModifiers.Length); 113Assert.Equal(1, p6Type.PointedAtTypeWithAnnotations.CustomModifiers.Length); 114var p6TypeMod = p6Type.PointedAtTypeWithAnnotations.CustomModifiers[0]; 121Assert.Equal(1, m7.ReturnTypeWithAnnotations.CustomModifiers.Length); 123var m7Mod = m7.ReturnTypeWithAnnotations.CustomModifiers[0]; 166Assert.Equal(1, volatileFld.TypeWithAnnotations.CustomModifiers.Length); 168var volatileFldMod = volatileFld.TypeWithAnnotations.CustomModifiers[0]; 193Assert.Equal(0, m1.ReturnTypeWithAnnotations.CustomModifiers.Length); 204Assert.Equal(0, p1.TypeWithAnnotations.CustomModifiers.Length); 214Assert.Equal(0, p1.TypeWithAnnotations.CustomModifiers.Length);
Symbols\Retargeting\RetargetingTests.cs (6)
873getModifierTypeSymbol(ptrOriginal.Signature.ReturnTypeWithAnnotations.CustomModifiers), 874getModifierTypeSymbol(ptrRetargeted.Signature.ReturnTypeWithAnnotations.CustomModifiers)); 891getModifierTypeSymbol(param1Original.TypeWithAnnotations.CustomModifiers), 892getModifierTypeSymbol(param1Retargeted.TypeWithAnnotations.CustomModifiers)); 901getModifierTypeSymbol(param2Original.TypeWithAnnotations.CustomModifiers), 902getModifierTypeSymbol(param2Retargeted.TypeWithAnnotations.CustomModifiers));
Symbols\Source\CustomModifierCopyTests.cs (46)
331CheckCustomModifier(inReturnType, ((ArrayTypeSymbol)method.ReturnType).ElementTypeWithAnnotations.CustomModifiers); 332CheckCustomModifier(onReturnType, method.ReturnTypeWithAnnotations.CustomModifiers); 336CheckCustomModifier(inParameterType, ((ArrayTypeSymbol)method.Parameters.Single().Type).ElementTypeWithAnnotations.CustomModifiers); 337CheckCustomModifier(onParameterType, method.Parameters.Single().TypeWithAnnotations.CustomModifiers); 349CheckCustomModifier(inType, ((ArrayTypeSymbol)property.Type).ElementTypeWithAnnotations.CustomModifiers); 350CheckCustomModifier(onType, property.TypeWithAnnotations.CustomModifiers); 433Assert.False(class3Method1.Parameters.Single().TypeWithAnnotations.CustomModifiers.Any()); 477var classMethod1CustomModifiers = classMethod1.Parameters.Single().TypeWithAnnotations.CustomModifiers; 1649Assert.Equal(int8Type, baseProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1650Assert.Equal(int8Type, derivedProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1652Assert.Equal(int16Type, baseProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1653Assert.Equal(int16Type, derivedProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1655Assert.Equal(int8Type, baseIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1656Assert.Equal(int8Type, derivedIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1658Assert.Equal(int16Type, baseIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1659Assert.Equal(int16Type, derivedIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1661Assert.Equal(int32Type, baseIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1662Assert.Equal(int32Type, derivedIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1664Assert.Equal(int64Type, baseIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1665Assert.Equal(int64Type, derivedIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1768Assert.Equal(int8Type, baseProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1769Assert.Equal(int8Type, derivedProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1771Assert.Equal(int8Type, baseIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1772Assert.Equal(int8Type, derivedIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1774Assert.Equal(int16Type, baseIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1775Assert.Equal(int16Type, derivedIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1863Assert.Equal(int8Type, interfaceProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1864Assert.Equal(int8Type, implementationProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1866Assert.Equal(int16Type, interfaceProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1867Assert.Equal(int16Type, implementationProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1869Assert.Equal(int8Type, interfaceIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1870Assert.Equal(int8Type, implementationIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1872Assert.Equal(int16Type, interfaceIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1873Assert.Equal(int16Type, implementationIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1875Assert.Equal(int32Type, interfaceIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1876Assert.Equal(int32Type, implementationIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1878Assert.Equal(int64Type, interfaceIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1879Assert.Equal(int64Type, implementationIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1967Assert.Equal(int8Type, interfaceProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1968Assert.Equal(int8Type, implementationProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1970Assert.Equal(int8Type, interfaceIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1971Assert.Equal(int8Type, implementationIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1973Assert.Equal(int16Type, interfaceIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1974Assert.Equal(int16Type, implementationIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2002Assert.Equal(ConstModOptType, param.TypeWithAnnotations.CustomModifiers.Single().Modifier.ToTestDisplayString()); 2011Assert.Equal(0, param.TypeWithAnnotations.CustomModifiers.Length);
Symbols\Source\FieldTests.cs (4)
148Assert.Equal(0, n1.TypeWithAnnotations.CustomModifiers.Length); 154Assert.Equal(1, n2.TypeWithAnnotations.CustomModifiers.Length); 155CustomModifier mod = n2.TypeWithAnnotations.CustomModifiers[0]; 163Assert.Equal(0, n3.TypeWithAnnotations.CustomModifiers.Length);
Symbols\Source\ModifierTests.cs (2)
171Assert.Equal(customModifiers, substitutedPointerType.PointedAtTypeWithAnnotations.CustomModifiers); 172Assert.Equal(customModifiers, substitutedArrayType.ElementTypeWithAnnotations.CustomModifiers);