31 overrides of TypeParameters
Microsoft.CodeAnalysis.CSharp (31)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
159public override ImmutableArray<TypeParameterSymbol> TypeParameters
Lowering\SynthesizedMethodBaseSymbol.cs (1)
76public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
113public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\ErrorMethodSymbol.cs (1)
150public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Extensions\RewrittenMethodSymbol.cs (1)
30public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
820public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
906public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\NativeIntegerTypeSymbol.cs (1)
362public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\ReducedExtensionMethodSymbol.cs (1)
286public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
93public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\SignatureOnlyMethodSymbol.cs (1)
71public override ImmutableArray<TypeParameterSymbol> TypeParameters { get { return _typeParameters; } }
Symbols\Source\LambdaSymbol.cs (1)
193public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\LocalFunctionSymbol.cs (1)
317public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceConstructorSymbolBase.cs (1)
140public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
145public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceDestructorSymbol.cs (1)
110public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceEventAccessorSymbol.cs (1)
186public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
80public abstract override ImmutableArray<TypeParameterSymbol> TypeParameters { get; }
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
335public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
998public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\SubstitutedMethodSymbol.cs (1)
92public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
176public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
92public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
160public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
86public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
132public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
163public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
247public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
209public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
131public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
64public override ImmutableArray<TypeParameterSymbol> TypeParameters
493 references to TypeParameters
Microsoft.CodeAnalysis.CSharp (61)
Binder\Binder_Conversions.cs (2)
1484var typeParameters = member.TypeParameters; 1534member.TypeParameters,
Binder\InMethodBinder.cs (1)
334var typeParameters = _methodSymbol.TypeParameters;
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3280constructedFromMethod.TypeParameters,
Binder\WithMethodTypeParametersBinder.cs (2)
45foreach (var typeParameter in _methodSymbol.TypeParameters) 69foreach (var parameter in _methodSymbol.TypeParameters)
Compilation\SyntaxTreeSemanticModel.cs (1)
2220return this.GetTypeParameterSymbol(methodSymbol.TypeParameters, typeParameter).GetPublicSymbol();
Compiler\ClsComplianceChecker.cs (1)
331CheckTypeParameterCompliance(symbol.TypeParameters, symbol.ContainingType);
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (4)
459SymbolKind.Method => ((MethodSymbol)otherContainer).TypeParameters, 618method.TypeParameters.SequenceEqual(other.TypeParameters, AreTypesEqual); 625var typeParameters = method.TypeParameters;
Emitter\Model\MethodSymbolAdapter.cs (1)
358foreach (var @param in AdaptedMethodSymbol.TypeParameters)
Emitter\NoPia\EmbeddedMethod.cs (1)
47return UnderlyingMethod.AdaptedMethodSymbol.TypeParameters.SelectAsArray((t, m) => new EmbeddedTypeParameter(m, t.GetCciAdapter()), this);
Lowering\ClosureConversion\ClosureConversion.cs (1)
190_currentTypeParameters = method.TypeParameters;
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (4)
193var typeMap = (methodDefinition.Arity > 0) ? new TypeMap(overload.TypeParameters, methodDefinition.TypeParameters) : null; 210methodDefinition.TypeParameters, 212overload.TypeParameters,
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
185if (usedTypeParametersContains(usedTypeParameters, enclosingMethod.TypeParameters))
Lowering\LocalRewriter\LocalRewriter.cs (1)
389var typeParameters = localFunction.TypeParameters;
Symbols\ConstraintsHelper.cs (1)
873((MethodSymbol)method.OriginalDefinition).TypeParameters,
Symbols\ConstructedMethodSymbol.cs (1)
20map: new TypeMap(constructedFrom.ContainingType, ((MethodSymbol)constructedFrom.OriginalDefinition).TypeParameters, typeArgumentsWithAnnotations),
Symbols\Extensions\RewrittenLambdaOrLocalFunctionSymbol.cs (1)
16: base(lambdaOrLocalFunctionSymbol, containingMethod.TypeMap, lambdaOrLocalFunctionSymbol.TypeParameters, propagateTypeParameterAttributes: false)
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (1)
22: base(sourceMethod, TypeMap.Empty, sourceMethod.ContainingType.TypeParameters.Concat(sourceMethod.TypeParameters), propagateTypeParameterAttributes: true)
Symbols\MemberSymbolExtensions.cs (3)
138? method.ContainingType.TypeParameters.Concat(method.TypeParameters) 139: method.TypeParameters; 562return ((MethodSymbol)symbol).TypeParameters;
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
228candidateMethod.TypeParameters,
Symbols\Metadata\PE\PENamedTypeSymbol.cs (3)
516ImmutableArray<TypeParameterSymbol> combinedTypeParameters = @this.TypeParameters.Concat(method.TypeParameters); 517var typeMap = combinedTypeParameters.IsEmpty ? null : new TypeMap(combinedTypeParameters, candidate.TypeParameters); 555candidate.TypeParameters,
Symbols\MethodSymbol.cs (3)
275return TypeMap.TypeParametersAsTypeSymbolsWithAnnotations(TypeParameters); 883if (ConstructedNamedTypeSymbol.TypeParametersMatchTypeArguments(this.TypeParameters, typeArguments)) 980GetUnificationUseSiteDiagnosticRecursive(ref diagnosticInfo, this.TypeParameters, this, ref unificationCheckedTypes))
Symbols\PublicModel\MethodSymbol.cs (1)
118return _underlying.TypeParameters.GetPublicSymbols();
Symbols\ReducedExtensionMethodSymbol.cs (2)
174var typeParams = method.TypeParameters; 234method.TypeParameters,
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
106this.RetargetingTranslator.Retarget(_underlyingMethod.TypeParameters), default(ImmutableArray<TypeParameterSymbol>));
Symbols\Source\ParameterHelpers.cs (1)
212methodOwner.TypeParameters :
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
988overriddenMethod = overriddenMethod.Construct(TypeMap.TypeParametersAsTypeSymbolsWithIgnoredAnnotations(overridingMethod.TypeParameters));
Symbols\Source\SourceMemberMethodSymbol.cs (3)
838return TypeParameters.Length; 934foreach (var typeParameter in this.TypeParameters) 1018foreach (var typeParameter in method.TypeParameters)
Symbols\Source\SourceMethodSymbol.cs (2)
24/// array of types, indexed by the constrained type parameter in <see cref="MethodSymbol.TypeParameters"/>. 30/// array of kinds, indexed by the constrained type parameter in <see cref="MethodSymbol.TypeParameters"/>.
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
704overriddenOrExplicitlyImplementedMethod.TypeParameters[i], overriddenOrExplicitlyImplementedMethod);
Symbols\Source\SourceTypeParameterSymbol.cs (3)
653get { return Owner.TypeParameters; } 814return ((object)overriddenMethod != null) ? overriddenMethod.TypeParameters[ordinal] : null; 826var overriddenTypeParameters = overriddenMethod.TypeParameters;
Symbols\SubstitutedMethodSymbol.cs (3)
58_lazyTypeParameters = constructedFrom.TypeParameters; 119typeParameters = prevMap.SubstituteTypeParameters(this.OriginalDefinition.TypeParameters); 415var typeParameters = method.OriginalDefinition.TypeParameters;
Symbols\SubstitutedTypeParameterSymbol.cs (1)
71return reducedFrom.TypeParameters[this.Ordinal];
Symbols\TypeMap.cs (2)
148return WithAlphaRename(oldOwner.OriginalDefinition.TypeParameters, newOwner, propagateAttributes: propagateAttributes, out newTypeParameters); 171var currentParameters = oldOwner.OriginalDefinition.TypeParameters;
Symbols\TypeSymbol.cs (4)
1622interfaceMethod.TypeParameters, 1964implementedMethod = implementedMethod.Construct(TypeMap.TypeParametersAsTypeSymbolsWithIgnoredAnnotations(implementingMethod.TypeParameters)); 2117var typeParameters1 = interfaceMethod.TypeParameters; 2118var typeParameters2 = implicitImpl.TypeParameters;
Symbols\VarianceSafety.cs (1)
160CheckTypeParametersVarianceSafety(method.TypeParameters, method, diagnostics);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (14)
CodeGen\CodeGenLocalFunctionTests.cs (3)
5250var attrs4 = localFn4.TypeParameters.Single().GetAttributes(); 5638Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.TypeParameters.Single().GetAttributes())); 5649Assert.Empty(localFn1.TypeParameters.Single().GetAttributes());
CodeGen\CodeGenTupleTest.cs (7)
11635var typeParameters1 = ((MethodSymbol)members1[i]).TypeParameters; 11636var typeParameters2 = ((MethodSymbol)members2[i]).TypeParameters; 12861Assert.True(m1ToString.TypeParameters.IsEmpty); 13536Assert.NotSame(m9Test.TypeParameters.Single(), m9Test.TypeParameters.Single().OriginalDefinition); 13537Assert.Same(m9Test, m9Test.TypeParameters.Single().ContainingSymbol); 13539Assert.Equal(0, m9Test.TypeParameters.Single().Ordinal);
CodeGen\DestructorTests.cs (1)
836Assert.Equal(0, destructor.TypeParameters.Length);
Emit\EmitMetadataTests.cs (3)
472Assert.Same(m5.TypeParameters[0], m5.Parameters[0].Type); 473Assert.Same(m5.TypeParameters[1], m5.Parameters[1].Type); 617Assert.Equal(0, ctor.TypeParameters.Length);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (21)
Emit\UnmanagedTypeModifierTests.cs (21)
639var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 645var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 674var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 687var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 720var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 726var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 752var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 765var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 795var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 801var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 827var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 840var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 870var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 876var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 902var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 915var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 945var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 951var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("Parent.M").TypeParameters.Single(); 978var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 991var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("Parent.M").TypeParameters.Single(); 1446var typeParameter = c.GlobalNamespace.GetTypeMember("TestRef").GetMethod("M").TypeParameters.Single();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (42)
Attributes\AttributeTests.cs (4)
5097var typeParam1 = gooMethod.TypeParameters[0]; 5101var typeParam2 = gooMethod.TypeParameters[1]; 5828var methodTypeParameter = method.TypeParameters.Single(); 10000Assert.Equal("XAttribute", mm.TypeParameters.Single().GetAttributes().Single().ToString());
Attributes\AttributeTests_IsUnmanaged.cs (8)
40var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 94var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 143var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 205var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 260var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 323var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 373var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 420var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single();
Attributes\AttributeTests_Synthesized.cs (1)
631var typeParameter = baseMethodWrapper.TypeParameters.Single();
RefStructInterfacesTests.cs (22)
4430var t = method.TypeParameters.Single(); 4693var t = method.TypeParameters.Single(); 4730var t = method.TypeParameters.Single(); 4785var t = method.TypeParameters.Single(); 4822var t = method.TypeParameters.Single(); 5261var t = method.TypeParameters.Single(); 5290var t = method.TypeParameters.Single(); 5319var t = method.TypeParameters.Single(); 5348var t = method.TypeParameters.Single(); 5377var t = method.TypeParameters.Single(); 5421var t1 = method1.TypeParameters.Single(); 5425var t2 = method2.TypeParameters.Single(); 5460var t1 = method1.TypeParameters.Single(); 5464var t2 = method2.TypeParameters.Single(); 5515var t1 = method1.TypeParameters.Single(); 5520var t2 = method2.TypeParameters.Single(); 5558var t1 = method1.TypeParameters.Single(); 5562var t2 = method2.TypeParameters.Single(); 5593var t1 = method1.TypeParameters.Single(); 5597var t2 = method2.TypeParameters.Single(); 5644var t1 = method1.TypeParameters.Single(); 5649var t2 = method2.TypeParameters.Single();
Semantics\ExtensionTests2.cs (7)
31347Assert.Equal("AAttribute", implementation.TypeParameters.Single().GetAttributes().Single().ToString()); 31377Assert.Equal("AAttribute", extensionMethod.TypeParameters.Single().GetAttributes().Single().ToString()); 31381Assert.Equal("AAttribute", implementation.TypeParameters.Single().GetAttributes().Single().ToString()); 31551Assert.Equal("AAttribute", getterImplementation.TypeParameters.Single().GetAttributes().Single().ToString()); 31624Assert.Equal("AAttribute", implementation.TypeParameters.Single().GetAttributes().Single().ToString()); 31851Assert.True(implementation.TypeParameters.Single().HasUnmanagedTypeConstraint); 31963Assert.Equal("AAttribute", implementation.TypeParameters.Single().GetAttributes().Single().ToString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (226)
Semantics\BindingTests.cs (1)
2662var tt = foo.TypeParameters[0];
Semantics\DynamicTests.cs (1)
2186var ebc = m.TypeParameters[0].EffectiveBaseClassNoUseSiteDiagnostics;
Semantics\GenericConstraintsTests.cs (7)
630var constraintTypeNames = method.TypeParameters.Single().ConstraintTypes().Select(type => type.ToTestDisplayString()); 1143var constraintTypeNames = method.TypeParameters.Single().ConstraintTypes().Select(type => type.ToTestDisplayString()); 1628var constraintTypeNames = method.TypeParameters.Single().ConstraintTypes().Select(type => type.ToTestDisplayString()); 2143var typeParameter = module.GlobalNamespace.GetTypeMember("Test").GetMethod("M").TypeParameters.Single(); 2194var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 3145Assert.Equal(declaredMethod.TypeParameters.Single().GetPublicSymbol(), inferredMethod.TypeArguments.Single()); 3201Assert.Equal(declaredMethod.TypeParameters.Single().GetPublicSymbol(), inferredMethod.TypeArguments.Single());
Semantics\LambdaTests.cs (1)
5637var expectedType = comp.GetMember<MethodSymbol>("Program.F").TypeParameters.Single().GetPublicSymbol();
Semantics\NativeIntegerTests.cs (1)
1184comp.GetMember<MethodSymbol>("B.F").TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].Type;
Semantics\NullableReferenceTypesTests.cs (215)
9027constraintType = method.TypeParameters.Single().ConstraintTypesNoUseSiteDiagnostics.Single(); 13208Assert.False(member.ReturnTypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 13326var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13334var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13413var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13688Assert.False(m1.Parameters[0].TypeWithAnnotations.Equals(m1.OverriddenMethod.ConstructIfGeneric(m1.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 14028Assert.False(member.ReturnTypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 14033Assert.True(m3.ReturnTypeWithAnnotations.Equals(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 14135Assert.False(member.Parameters[0].TypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 14140Assert.True(m3.Parameters[0].TypeWithAnnotations.Equals(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 16503var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 16511var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17733var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17741var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17801var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17809var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17877var m1Def = m1.ConstructIfGeneric(m1Impl.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 97716TypeParameterSymbol t1 = f1.TypeParameters[0]; 97726TypeParameterSymbol t2 = f2.TypeParameters[0]; 97887TypeParameterSymbol t2 = f2.TypeParameters[0]; 98493TypeParameterSymbol t11 = bf1.TypeParameters[0]; 98508TypeParameterSymbol t22 = bf2.TypeParameters[0]; 98552TypeParameterSymbol t11 = bf1.TypeParameters[0]; 98560TypeParameterSymbol t22 = bf2.TypeParameters[0]; 98566TypeParameterSymbol t2 = af2.TypeParameters[0]; 98684TypeParameterSymbol t11 = bf1.TypeParameters[0]; 98699TypeParameterSymbol t22 = bf2.TypeParameters[0]; 98791TypeParameterSymbol t11 = bf1.TypeParameters[0]; 98806TypeParameterSymbol t22 = bf2.TypeParameters[0]; 98857TypeParameterSymbol t11 = bf1.TypeParameters[0]; 98875TypeParameterSymbol t22 = bf2.TypeParameters[0]; 98930TypeParameterSymbol t11 = bf1.TypeParameters[0]; 98947TypeParameterSymbol t22 = bf2.TypeParameters[0]; 98998TypeParameterSymbol t11 = bf1.TypeParameters[0]; 99013TypeParameterSymbol t22 = bf2.TypeParameters[0]; 99049TypeParameterSymbol t11 = bf1.TypeParameters[0]; 99054TypeParameterSymbol t22 = bf2.TypeParameters[0]; 99088TypeParameterSymbol t2 = f2.TypeParameters[0]; 99372TypeParameterSymbol t11 = bf1.TypeParameters[0]; 99387TypeParameterSymbol t22 = bf2.TypeParameters[0]; 100159TypeParameterSymbol t11 = bf1.TypeParameters[0]; 100163TypeParameterSymbol t22 = bf2.TypeParameters[0]; 100167TypeParameterSymbol t33 = bf3.TypeParameters[0]; 100171TypeParameterSymbol t44 = bf4.TypeParameters[0]; 100194TypeParameterSymbol t11 = bf1.TypeParameters[0]; 100198TypeParameterSymbol t22 = bf2.TypeParameters[0]; 100202TypeParameterSymbol t33 = bf3.TypeParameters[0]; 100206TypeParameterSymbol t44 = bf4.TypeParameters[0]; 100286TypeParameterSymbol t222 = bf2.TypeParameters[0]; 100290TypeParameterSymbol t333 = bf3.TypeParameters[0]; 100313TypeParameterSymbol t222 = bf2.TypeParameters[0]; 100317TypeParameterSymbol t333 = bf3.TypeParameters[0]; 100366TypeParameterSymbol t1 = f1.TypeParameters[0]; 100404TypeParameterSymbol t1 = f1.TypeParameters[0]; 100448TypeParameterSymbol t1 = f1.TypeParameters[0]; 100455TypeParameterSymbol t2 = f2.TypeParameters[0]; 100487TypeParameterSymbol t1 = f1.TypeParameters[0]; 100507TypeParameterSymbol t1 = f1.TypeParameters[0]; 100562TypeParameterSymbol t1 = f1.TypeParameters[0]; 100570TypeParameterSymbol t2 = f2.TypeParameters[0]; 100606TypeParameterSymbol t1 = f1.TypeParameters[0]; 100613TypeParameterSymbol t2 = f2.TypeParameters[0]; 100636Assert.True(((MethodSymbol)comp.SourceModule.GlobalNamespace.GetMember("B.F1")).TypeParameters[0].IsNotNullable); 100651TypeParameterSymbol t1 = f1.TypeParameters[0]; 100658TypeParameterSymbol t2 = f2.TypeParameters[0]; 100690TypeParameterSymbol t1 = f1.TypeParameters[0]; 100740TypeParameterSymbol at1 = af1.TypeParameters[0]; 100754Assert.Null(impl.TypeParameters[0].IsNotNullable); 100770TypeParameterSymbol tf1 = bf1.TypeParameters[0]; 100785Assert.Null(impl.TypeParameters[0].IsNotNullable); 100835TypeParameterSymbol at1 = af1.TypeParameters[0]; 100863TypeParameterSymbol tf1 = bf1.TypeParameters[0]; 100923TypeParameterSymbol at1 = af1.TypeParameters[0]; 100948TypeParameterSymbol tf1 = bf1.TypeParameters[0]; 100984TypeParameterSymbol t1 = f1.TypeParameters[0]; 101008TypeParameterSymbol t1 = f1.TypeParameters[0]; 101033TypeParameterSymbol t1 = f1.TypeParameters[0]; 101060TypeParameterSymbol t1 = f1.TypeParameters[0]; 101109TypeParameterSymbol at1 = af1.TypeParameters[0]; 101134TypeParameterSymbol tf1 = bf1.TypeParameters[0]; 101191TypeParameterSymbol at1 = af1.TypeParameters[0]; 101216TypeParameterSymbol tf1 = bf1.TypeParameters[0]; 101993TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102016foreach (TypeParameterSymbol tf1 in f1.TypeParameters) 102045TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102072TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102099TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102126TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102153TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102195TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102226TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102264TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102298foreach (TypeParameterSymbol tf1 in f1.TypeParameters) 102338TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102376TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102403TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102431TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102459TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102498TypeParameterSymbol tf1 = f1.TypeParameters[0]; 102526TypeParameterSymbol tf1 = f1.TypeParameters[0]; 104229Assert.Null(m1.TypeParameters[0].IsNotNullable); 104230Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104251Assert.Null(m1.TypeParameters[0].IsNotNullable); 104252Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104277Assert.False(m1.TypeParameters[0].IsNotNullable); 104278Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104298Assert.False(m1.TypeParameters[0].IsNotNullable); 104299Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104348Assert.False(m1.TypeParameters[0].IsNotNullable); 104349Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104374Assert.Null(m1.TypeParameters[0].IsNotNullable); 104375Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104404Assert.False(m1.TypeParameters[0].IsNotNullable); 104405Assert.True(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104436Assert.Null(m1.TypeParameters[0].IsNotNullable); 104437Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104491Assert.Null(m1.TypeParameters[0].IsNotNullable); 104492Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104586Assert.False(m1.TypeParameters[0].IsNotNullable); 104587Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104613Assert.Null(m1.TypeParameters[0].IsNotNullable); 104614Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104663Assert.True(m1.TypeParameters[0].IsNotNullable); 104664Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104689Assert.True(m1.TypeParameters[0].IsNotNullable); 104690Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104720Assert.True(m1.TypeParameters[0].IsNotNullable); 104721Assert.False(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104752Assert.False(m1.TypeParameters[0].IsNotNullable); 104753Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104806Assert.False(m1.TypeParameters[0].IsNotNullable); 104807Assert.Null(m1.PartialImplementationPart.TypeParameters[0].IsNotNullable); 104875TypeParameterSymbol t11 = bf1.TypeParameters[0]; 104888TypeParameterSymbol t1 = af1.TypeParameters[0]; 104902TypeParameterSymbol t22 = bf2.TypeParameters[0]; 104916TypeParameterSymbol t2 = af2.TypeParameters[0]; 104979TypeParameterSymbol t11 = bf1.TypeParameters[0]; 104986TypeParameterSymbol t22 = bf2.TypeParameters[0]; 105056TypeParameterSymbol t11 = bf1.TypeParameters[0]; 105063TypeParameterSymbol t22 = bf2.TypeParameters[0]; 105154Assert.True(m1.TypeParameters[0].IsNotNullable); 105158Assert.True(baseM1.TypeParameters[0].IsNotNullable); 105198Assert.Null(m1.TypeParameters[0].IsNotNullable); 105202Assert.Null(baseM1.TypeParameters[0].IsNotNullable); 105247Assert.True(m1.TypeParameters[0].IsNotNullable); 105251Assert.True(baseM1.TypeParameters[0].IsNotNullable); 105283Assert.True(m1.TypeParameters[0].IsNotNullable); 105287Assert.True(baseM1.TypeParameters[0].IsNotNullable); 106224Assert.Null(m1.TypeParameters[0].IsNotNullable); 106255Assert.True(m1.TypeParameters[0].IsNotNullable); 106286Assert.False(m1.TypeParameters[0].IsNotNullable); 106318Assert.Null(m1.TypeParameters[0].IsNotNullable); 106351Assert.Null(m1.TypeParameters[0].IsNotNullable); 106384Assert.True(m1.TypeParameters[0].IsNotNullable); 106416Assert.True(m1.TypeParameters[0].IsNotNullable); 106448Assert.True(m1.TypeParameters[0].IsNotNullable); 106481Assert.True(m1.TypeParameters[0].IsNotNullable); 106511Assert.Null(m1.TypeParameters[0].IsNotNullable); 106542Assert.Null(m1.TypeParameters[0].IsNotNullable); 106573Assert.True(m1.TypeParameters[0].IsNotNullable); 106605Assert.True(m1.TypeParameters[0].IsNotNullable); 106637Assert.True(m1.TypeParameters[0].IsNotNullable); 106670Assert.True(m1.TypeParameters[0].IsNotNullable); 106701Assert.True(m1.TypeParameters[0].IsNotNullable); 106733Assert.True(m1.TypeParameters[0].IsNotNullable); 106764Assert.True(m1.TypeParameters[0].IsNotNullable); 106796Assert.True(m1.TypeParameters[0].IsNotNullable); 106826Assert.True(m1.TypeParameters[0].IsNotNullable); 106856Assert.True(m1.TypeParameters[0].IsNotNullable); 106886Assert.Null(m1.TypeParameters[0].IsNotNullable); 106916Assert.True(m1.TypeParameters[0].IsNotNullable); 107106Assert.Null(m1.TypeParameters[0].IsNotNullable); 107110Assert.Null(m2.TypeParameters[0].IsNotNullable); 107114Assert.Null(m3.TypeParameters[0].IsNotNullable); 107118Assert.Null(m4.TypeParameters[0].IsNotNullable); 107122Assert.True(m5.TypeParameters[0].IsNotNullable); 107126Assert.True(m6.TypeParameters[0].IsNotNullable); 107130Assert.False(m7.TypeParameters[0].IsNotNullable); 107134Assert.True(m8.TypeParameters[0].IsNotNullable); 107138Assert.True(m9.TypeParameters[0].IsNotNullable); 107142Assert.Null(m10.TypeParameters[0].IsNotNullable); 107177Assert.Null(m1.TypeParameters[0].IsNotNullable); 107212Assert.Null(m1.TypeParameters[0].IsNotNullable); 107243Assert.Null(m1.TypeParameters[0].IsNotNullable); 107280Assert.Null(m1.TypeParameters[0].IsNotNullable); 107316Assert.Null(m1.TypeParameters[0].IsNotNullable); 107353Assert.True(m1.TypeParameters[0].IsNotNullable); 107389Assert.True(m1.TypeParameters[0].IsNotNullable); 107427Assert.Null(t2m1.TypeParameters[0].IsNotNullable); 107431Assert.Null(t3m1.TypeParameters[0].IsNotNullable); 107474Assert.Null(t3m1.TypeParameters[0].IsNotNullable); 107512Assert.True(t2m1.TypeParameters[0].IsNotNullable); 107516Assert.True(t3m1.TypeParameters[0].IsNotNullable); 107553Assert.Null(m1.TypeParameters[0].IsNotNullable); 107589Assert.Null(m1.TypeParameters[0].IsNotNullable); 107626Assert.True(m1.TypeParameters[0].IsNotNullable); 107662Assert.True(m1.TypeParameters[0].IsNotNullable); 107698Assert.False(m1.TypeParameters[0].IsNotNullable); 107734Assert.True(m1.TypeParameters[0].IsNotNullable); 107770Assert.Null(m1.TypeParameters[0].IsNotNullable); 108340TypeParameterSymbol tm1 = m1.TypeParameters[0]; 111778var constraintTypes = comp.GetMember<MethodSymbol>(methodName).TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics; 138832Assert.Equal("System.IEquatable<T>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138833Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138856Assert.True(f.TypeParameters[0].ReferenceTypeConstraintIsNullable); 138857Assert.Equal("System.IEquatable<T?>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138858Assert.Null(f.PartialImplementationPart.TypeParameters[0].ReferenceTypeConstraintIsNullable); 138859Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 150605Assert.True(comp.GetMember<MethodSymbol>("B1.F").TypeParameters[0].IsValueType); 150606Assert.False(comp.GetMember<MethodSymbol>("B2.F").TypeParameters[0].IsValueType); 150607Assert.True(comp.GetMember<MethodSymbol>("B3.F").TypeParameters[0].IsValueType); 158405var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158438var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158660var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158697var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (126)
DocumentationComments\CrefTests.cs (3)
1484Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1510Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1607Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument);
DocumentationComments\ParameterTests.cs (3)
87var typeParameter = method.TypeParameters.Single().ISymbol; 354var typeParameters = method.TypeParameters.GetPublicSymbols(); 379var typeParameter = method.TypeParameters.Single().ISymbol;
Symbols\CompilationCreationTests.cs (2)
2386Assert.Equal(0, foo2.TypeParameters.Length); 2398var foo3TypeParams = foo3.TypeParameters;
Symbols\CSharpCompilerFeatureRequiredTests.cs (1)
217Assert.True(onMethodTypeParameterMethod.TypeParameters[0].HasUnsupportedMetadata);
Symbols\FunctionPointerTypeSymbolTests.cs (1)
376var t = m.TypeParameters.Single();
Symbols\GenericConstraintTests.cs (53)
83CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T"); 87CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T"); 91CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, true, false, "ValueType", "int", "int"); 117CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, true, "C", "C", "C"); 157CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T"); 161CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "I<T>"); 166CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T"); 171CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "I<T>"); 4884var typeParameter = method.TypeParameters[0]; 4889typeParameter = method.TypeParameters[1]; 4895typeParameter = method.TypeParameters[0]; 4900typeParameter = method.TypeParameters[1]; 5175CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T", "U"); 5178CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T", "I<U>", "I<object>"); 5181CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "I<T>", "I<U>"); 5184CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "T"); 5187CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "I<object>", "I<T>"); 5190CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "I<I<U>>"); 5331CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5332CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.ValueType, true, false, "ValueType", "ValueType"); 5334CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5335CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.ValueType, true, false, "ValueType", "ValueType"); 5337CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "ValueType", "ValueType", "ValueType"); 5338CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.ValueType, true, false, "ValueType", "ValueType"); 5512CheckConstraints(type.Interfaces()[0].GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5514CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5516CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5518CheckConstraints(type.Interfaces()[0].GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5520CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5522CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5524CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5526CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5528CheckConstraints(type.GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5530CheckConstraints(type.GetMethod("I<System.Object>.M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5532CheckConstraints(type.BaseType().GetMember<MethodSymbol>("M").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5567CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5569CheckConstraints(method.TypeParameters[0], TypeParameterConstraintKind.None, false, true, "C", "C", "C"); 5631CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object"); 5632CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.ValueType, true, false, "ValueType", "ValueType"); 5634CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "ValueType", "ValueType", "ValueType"); 5635CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.ValueType, true, false, "ValueType", "ValueType", "ValueType"); 5637CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "IA"); 5638CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "IB"); 5639CheckConstraints(type.GetMember<MethodSymbol>("M3").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "A", "A", "A"); 5640CheckConstraints(type.GetMember<MethodSymbol>("M4").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "B", "B", "B"); 5642CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "IA"); 5643CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.None, false, false, "object", "object", "IB", "IA"); 5644CheckConstraints(type.GetMember<MethodSymbol>("M3").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "A", "A", "A", "IA"); 5645CheckConstraints(type.GetMember<MethodSymbol>("M4").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "B", "B", "B", "IA"); 5647CheckConstraints(type.GetMember<MethodSymbol>("M1").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "A", "A", "IA", "A"); 5648CheckConstraints(type.GetMember<MethodSymbol>("M2").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "A", "A", "IB", "A"); 5649CheckConstraints(type.GetMember<MethodSymbol>("M3").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "A", "A", "A"); 5650CheckConstraints(type.GetMember<MethodSymbol>("M4").TypeParameters[0], TypeParameterConstraintKind.None, false, true, "B", "B", "B", "A");
Symbols\LocalFunctionTests.cs (2)
591m.GlobalNamespace.GetMember<MethodSymbol>("Test1.<M2>g__local|0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString())); 630m.GlobalNamespace.GetMember<MethodSymbol>("Test1.<M2>g__local|0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
Symbols\Metadata\MetadataMemberTests.cs (3)
175Assert.Equal(0, ctor.TypeParameters.Length); 225Assert.Equal(0, member1.TypeParameters.Length); 331Assert.Equal(0, member2.TypeParameters.Length);
Symbols\Metadata\PE\LoadingMethods.cs (2)
159Assert.Equal(0, basicC1_M11.TypeParameters[0].ConstraintTypes().Length); 160Assert.Same(basicC1, basicC1_M11.TypeParameters[1].ConstraintTypes().Single());
Symbols\OverriddenOrHiddenMembersTests.cs (1)
98var ofV = ImmutableArray.Create<TypeSymbol>(D_MofV.TypeParameters[0]);
Symbols\Retargeting\RetargetCustomAttributes.cs (1)
245TypeParameterSymbol testTypeParameter = testMethod.TypeParameters[0];
Symbols\Retargeting\RetargetingTests.cs (2)
1234CheckSymbols(a.TypeParameters, b.TypeParameters, true);
Symbols\Source\FileModifierTests.cs (1)
3040var cInt = (ConstructedNamedTypeSymbol)comp.GetMember<MethodSymbol>("D.M").TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].Type;
Symbols\Source\MethodTests.cs (3)
345var t = m.TypeParameters[0]; 1363var classBMethodMTypeParameters = classBMethodM.TypeParameters; 1386var classCBaseMethodMTypeParameters = classCBaseMethodM.TypeParameters;
Symbols\StaticAbstractMembersInInterfacesTests.cs (45)
8448Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8449Assert.Contains("void I1.M01()", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 8450Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8451Assert.Contains("void I1.M01()", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 8453Assert.Equal("void I1.M01()", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 8454Assert.Contains("void I1.M01()", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 8455Assert.Equal("void I1.M01()", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 8456Assert.Contains("void I1.M01()", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 8458Assert.Contains("M01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 13174Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13175Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13176Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13177Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13179Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13180Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13181Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13182Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13184Assert.Contains("P01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 13260Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13261Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13262Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13263Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13265Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13266Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13267Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13268Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13270Assert.Contains("P01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 13382Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13383Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13384Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13385Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13387Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13388Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13389Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13390Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13392Assert.Contains("P01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 14092Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14093Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14094Assert.Contains("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 14095Assert.Contains("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 14097Assert.Equal("event System.Action I1.E01", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14098Assert.Equal("event System.Action I1.E01", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14099Assert.Contains("event System.Action I1.E01", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 14100Assert.Contains("event System.Action I1.E01", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 14102Assert.Contains("E01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()));
Symbols\SymbolErrorTests.cs (3)
3788Assert.Equal(2, f.TypeParameters.Length); 3789var param1 = f.TypeParameters[0]; 3790var param2 = f.TypeParameters[1];
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
FunctionPointerUtilities.cs (1)
94Assert.Empty(symbol.TypeParameters);
TestAttributesVisitor.cs (1)
56VisitList(method.TypeParameters);
UsesIsNullableVisitor.cs (1)
54return AddIfUsesIsNullable(symbol, symbol.TypeParameters, inProgress: null) ||