118 references to GenericParameterAttributes
Microsoft.CodeAnalysis (10)
MetadataReader\MetadataHelpers.cs (2)
36
public const System.Reflection.
GenericParameterAttributes
GenericParameterAttributesAllowByRefLike = (System.Reflection.
GenericParameterAttributes
)0x0020;
MetadataReader\PEModule.cs (1)
3321
out
GenericParameterAttributes
flags)
PEWriter\MetadataWriter.cs (7)
859
private static
GenericParameterAttributes
GetGenericParameterAttributes(IGenericParameter genPar)
861
GenericParameterAttributes
result = 0;
865
result |=
GenericParameterAttributes
.Covariant;
868
result |=
GenericParameterAttributes
.Contravariant;
874
result |=
GenericParameterAttributes
.ReferenceTypeConstraint;
879
result |=
GenericParameterAttributes
.NotNullableValueTypeConstraint;
889
result |=
GenericParameterAttributes
.DefaultConstructorConstraint;
Microsoft.CodeAnalysis.CSharp (14)
Symbols\Metadata\PE\PETypeParameterSymbol.cs (14)
41
private readonly
GenericParameterAttributes
_flags;
78
GenericParameterAttributes
flags = 0;
96
_flags = ((flags &
GenericParameterAttributes
.NotNullableValueTypeConstraint) == 0) ? flags : (flags & ~
GenericParameterAttributes
.DefaultConstructorConstraint);
235
if (hasUnmanagedModreqPattern && (_flags &
GenericParameterAttributes
.NotNullableValueTypeConstraint) == 0 ||
292
if (typeSymbol.SpecialType == SpecialType.System_ValueType && ((_flags &
GenericParameterAttributes
.NotNullableValueTypeConstraint) != 0))
451
return (_flags &
GenericParameterAttributes
.DefaultConstructorConstraint) != 0;
459
return (_flags &
GenericParameterAttributes
.ReferenceTypeConstraint) != 0;
509
return (_flags & (
GenericParameterAttributes
.NotNullableValueTypeConstraint |
GenericParameterAttributes
.ReferenceTypeConstraint)) == 0 &&
518
if ((_flags & (
GenericParameterAttributes
.NotNullableValueTypeConstraint |
GenericParameterAttributes
.ReferenceTypeConstraint)) == 0 &&
567
return (_flags &
GenericParameterAttributes
.NotNullableValueTypeConstraint) != 0;
601
return (VarianceKind)(_flags &
GenericParameterAttributes
.VarianceMask);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\GenericConstraintTests.cs (3)
6630
GenericParameterAttributes
flags;
6632
Assert.Equal(
GenericParameterAttributes
.DefaultConstructorConstraint, flags &
GenericParameterAttributes
.DefaultConstructorConstraint);
Microsoft.CodeAnalysis.Test.Utilities (3)
Platform\Custom\MetadataSignatureHelper.cs (3)
46
if (typeInfo.GenericParameterAttributes.HasFlag(
GenericParameterAttributes
.ReferenceTypeConstraint))
48
if (typeInfo.GenericParameterAttributes.HasFlag(
GenericParameterAttributes
.NotNullableValueTypeConstraint))
50
if (typeInfo.GenericParameterAttributes.HasFlag(
GenericParameterAttributes
.DefaultConstructorConstraint))
Microsoft.CodeAnalysis.VisualBasic (10)
Symbols\Metadata\PE\PETypeParameterSymbol.vb (10)
34
Private ReadOnly _flags As
GenericParameterAttributes
80
Dim flags As
GenericParameterAttributes
94
_flags = If((flags And
GenericParameterAttributes
.NotNullableValueTypeConstraint) = 0, flags, flags And Not
GenericParameterAttributes
.DefaultConstructorConstraint)
216
If ((_flags And
GenericParameterAttributes
.NotNullableValueTypeConstraint) <> 0) AndAlso
231
If (hasUnmanagedModreqPattern AndAlso (_flags And
GenericParameterAttributes
.NotNullableValueTypeConstraint) = 0) OrElse
287
Return (_flags And
GenericParameterAttributes
.DefaultConstructorConstraint) <> 0
293
Return (_flags And
GenericParameterAttributes
.ReferenceTypeConstraint) <> 0
299
Return (_flags And
GenericParameterAttributes
.NotNullableValueTypeConstraint) <> 0
311
Return CType((_flags And
GenericParameterAttributes
.VarianceMask), VarianceKind)
Microsoft.CSharp (5)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (5)
555
if ((t.GenericParameterAttributes &
GenericParameterAttributes
.Covariant) != 0)
559
if ((t.GenericParameterAttributes &
GenericParameterAttributes
.Contravariant) != 0)
566
if ((t.GenericParameterAttributes &
GenericParameterAttributes
.DefaultConstructorConstraint) != 0)
570
if ((t.GenericParameterAttributes &
GenericParameterAttributes
.ReferenceTypeConstraint) != 0)
574
if ((t.GenericParameterAttributes &
GenericParameterAttributes
.NotNullableValueTypeConstraint) != 0)
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\CallSiteFactory.cs (2)
120
bool serviceHasNewConstraint = serviceGenericType.GenericParameterAttributes.HasFlag(
GenericParameterAttributes
.DefaultConstructorConstraint);
121
bool implementationHasNewConstraint = implementationGenericType.GenericParameterAttributes.HasFlag(
GenericParameterAttributes
.DefaultConstructorConstraint);
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
454
(CBool(derived.GenericParameterAttributes() And
GenericParameterAttributes
.NotNullableValueTypeConstraint)) AndAlso
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
459
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
GenericParameterAttributes
))]
netstandard (1)
netstandard.cs (1)
1427
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
GenericParameterAttributes
))]
PresentationFramework (2)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (2)
158
bool argumentCovariant = (genericConstraints[i].GenericParameterAttributes &
GenericParameterAttributes
.VarianceMask) ==
GenericParameterAttributes
.Covariant;
System.ComponentModel.Composition (12)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (4)
219
GenericParameterAttributes
[] genericParameterAttributes = new
GenericParameterAttributes
[genericArguments.Length];
230
GenericParameterAttributes
attributes = genericArgument.GenericParameterAttributes;
232
if ((constraints != null) || (attributes !=
GenericParameterAttributes
.None))
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (6)
136
public static bool CanSpecialize(Type? type, IEnumerable<Type>? constraints,
GenericParameterAttributes
attributes)
161
public static bool CanSpecialize(Type type,
GenericParameterAttributes
attributes)
163
if (attributes ==
GenericParameterAttributes
.None)
169
if ((attributes &
GenericParameterAttributes
.ReferenceTypeConstraint) != 0)
178
if ((attributes &
GenericParameterAttributes
.DefaultConstructorConstraint) != 0)
188
if ((attributes &
GenericParameterAttributes
.NotNullableValueTypeConstraint) != 0)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (2)
551
GenericParameterAttributes
[]? genericParameterAttributes = partMetadata.GetValue<
GenericParameterAttributes
[]>(CompositionConstants.GenericParameterAttributesMetadataName);
System.Linq.Expressions (3)
System\Dynamic\Utils\TypeUtils.cs (3)
496
return 0 != (t.GenericParameterAttributes &
GenericParameterAttributes
.Covariant);
502
return 0 != (t.GenericParameterAttributes &
GenericParameterAttributes
.Contravariant);
508
return 0 == (t.GenericParameterAttributes &
GenericParameterAttributes
.VarianceMask);
System.Private.CoreLib (22)
LibraryImports.g.cs (2)
1148
private static partial int DefineGenericParam(global::System.Runtime.CompilerServices.QCallModule module, string name, int tkParent, global::System.Reflection.
GenericParameterAttributes
attributes, int position, int[] constraints)
1161
static extern unsafe int __PInvoke(global::System.Runtime.CompilerServices.QCallModule __module_native, ushort* __name_native, int __tkParent_native, global::System.Reflection.
GenericParameterAttributes
__attributes_native, int __position_native, int* __constraints_native);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\GenericTypeParameterBuilder.cs (2)
33
public void SetGenericParameterAttributes(
GenericParameterAttributes
genericParameterAttributes) => SetGenericParameterAttributesCore(genericParameterAttributes);
35
protected abstract void SetGenericParameterAttributesCore(
GenericParameterAttributes
genericParameterAttributes);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
77
public override
GenericParameterAttributes
GenericParameterAttributes => _unmodifiedType.GenericParameterAttributes;
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
98
public sealed override
GenericParameterAttributes
GenericParameterAttributes => throw new NotSupportedException(SR.NotSupported_SignatureType);
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (5)
732
GenericParameterAttributes
special = constraint.GenericParameterAttributes;
734
if ((special &
GenericParameterAttributes
.ReferenceTypeConstraint) == 0 &&
735
(special &
GenericParameterAttributes
.NotNullableValueTypeConstraint) == 0)
744
GenericParameterAttributes
special = GenericParameterAttributes;
745
if ((special &
GenericParameterAttributes
.NotNullableValueTypeConstraint) != 0)
src\libraries\System.Private.CoreLib\src\System\Type.cs (1)
86
public virtual
GenericParameterAttributes
GenericParameterAttributes => throw new NotSupportedException();
src\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs (2)
192
public override
GenericParameterAttributes
GenericParameterAttributes => m_type.GenericParameterAttributes;
233
protected override void SetGenericParameterAttributesCore(
GenericParameterAttributes
genericParameterAttributes)
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (4)
316
private
GenericParameterAttributes
m_genParamAttributes;
542
string name, int tkParent,
GenericParameterAttributes
attributes, int position, int[] constraints);
564
internal void SetGenParamAttributes(
GenericParameterAttributes
genericParameterAttributes)
1014
public override
GenericParameterAttributes
GenericParameterAttributes => m_genParamAttributes;
src\System\Reflection\MdImport.cs (2)
492
out
GenericParameterAttributes
attributes)
495
attributes = (
GenericParameterAttributes
)attributesRaw;
src\System\RuntimeType.CoreCLR.cs (2)
3566
public override
GenericParameterAttributes
GenericParameterAttributes
3574
module.MetadataImport.GetGenericParamProps(MetadataToken, out
GenericParameterAttributes
attributes);
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
67
public override
GenericParameterAttributes
GenericParameterAttributes
System.Reflection.Emit (3)
System\Reflection\Emit\GenericTypeParameterBuilderImpl.cs (3)
16
private
GenericParameterAttributes
_genParamAttributes;
57
protected override void SetGenericParameterAttributesCore(
GenericParameterAttributes
genericParameterAttributes) =>
74
public override
GenericParameterAttributes
GenericParameterAttributes => _genParamAttributes;
System.Reflection.Metadata (4)
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (1)
831
GenericParameterAttributes
attributes,
System\Reflection\Metadata\Internal\Tables.cs (2)
2468
internal
GenericParameterAttributes
GetFlags(GenericParameterHandle handle)
2471
return (
GenericParameterAttributes
)this.Block.PeekUInt16(rowOffset + _FlagsOffset);
System\Reflection\Metadata\TypeSystem\GenericParameter.cs (1)
44
public
GenericParameterAttributes
Attributes
System.Reflection.MetadataLoadContext (19)
System\Reflection\TypeLoading\General\Assignability.cs (9)
130
GenericParameterAttributes
attributes = fromTypeInfo.GenericParameterAttributes;
131
if ((attributes &
GenericParameterAttributes
.NotNullableValueTypeConstraint) != 0)
205
GenericParameterAttributes
attributes = genericTypeParameters[i].GenericParameterAttributes;
206
switch (attributes &
GenericParameterAttributes
.VarianceMask)
208
case
GenericParameterAttributes
.Covariant:
213
case
GenericParameterAttributes
.Contravariant:
218
case
GenericParameterAttributes
.None:
296
GenericParameterAttributes
attributes = t.GenericParameterAttributes;
297
if ((attributes &
GenericParameterAttributes
.ReferenceTypeConstraint) != 0)
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericParameterType.cs (1)
31
public sealed override
GenericParameterAttributes
GenericParameterAttributes => GenericParameter.Attributes;
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (1)
134
public sealed override
GenericParameterAttributes
GenericParameterAttributes => throw new InvalidOperationException(SR.Arg_NotGenericParameter);
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (1)
230
public sealed override
GenericParameterAttributes
GenericParameterAttributes => throw new InvalidOperationException(SR.Arg_NotGenericParameter);
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (1)
190
public sealed override
GenericParameterAttributes
GenericParameterAttributes => throw new InvalidOperationException(SR.Arg_NotGenericParameter);
System\Reflection\TypeLoading\Types\RoHasElementType.cs (1)
69
public sealed override
GenericParameterAttributes
GenericParameterAttributes => throw new InvalidOperationException(SR.Arg_NotGenericParameter);
System\Reflection\TypeLoading\Types\RoModifiedType.cs (1)
181
public override
GenericParameterAttributes
GenericParameterAttributes => _unmodifiedType.GenericParameterAttributes;
System\Reflection\TypeLoading\Types\RoStubType.cs (1)
63
public sealed override
GenericParameterAttributes
GenericParameterAttributes => throw null!;
System\Reflection\TypeLoading\Types\RoType.cs (3)
95
public abstract override
GenericParameterAttributes
GenericParameterAttributes { get; }
164
GenericParameterAttributes
genericParameterAttributes = baseType.GenericParameterAttributes;
165
if (0 == (genericParameterAttributes &
GenericParameterAttributes
.ReferenceTypeConstraint))
System.Reflection.Primitives (1)
artifacts\obj\System.Reflection.Primitives\Debug\net11.0\System.Reflection.Primitives.Forwards.cs (1)
13
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
GenericParameterAttributes
))]
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
467
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
GenericParameterAttributes
))]