Binding\Binder_Lookup.vb (11)
590LookupInTypeParameter(lookupResult, DirectCast(type, TypeParameterSymbol), name, arity, options, binder, tempResult, useSiteInfo)
619AddLookupSymbolsInfoInTypeParameter(nameSet, DirectCast(container, TypeParameterSymbol), options, binder)
943LookupDefaultPropertyInTypeParameter(result, DirectCast(container, TypeParameterSymbol), binder, tempResult, useSiteInfo)
1008typeParameter As TypeParameterSymbol,
1608typeParameter As TypeParameterSymbol,
1624typeParameter As TypeParameterSymbol,
1690Private Shared Sub AddInterfaceConstraints(typeParameter As TypeParameterSymbol,
1711AddInterfaceConstraints(DirectCast(constraintType, TypeParameterSymbol), allInterfaces, processedInterfaces, useSiteInfo)
2037typeParameter As TypeParameterSymbol,
2051typeParameter As TypeParameterSymbol,
2160Private Shared Function GetTypeParameterBaseType(typeParameter As TypeParameterSymbol) As NamedTypeSymbol
Semantics\Conversions.vb (15)
1993Not ClassOrBasesSatisfyConstraints(src, DirectCast(destination, TypeParameterSymbol), useSiteInfo) Then
2015Not ClassOrBasesSatisfyConstraints(dst, DirectCast(source, TypeParameterSymbol), useSiteInfo) Then
2026Private Shared Function ClassOrBasesSatisfyConstraints([class] As TypeSymbol, typeParam As TypeParameterSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As Boolean
2047Dim typeParameter = DirectCast(type, TypeParameterSymbol)
2759Dim typeParameters As ImmutableArray(Of TypeParameterSymbol) = source.TypeParameters
3350Dim constraint = DirectCast(typeParam, TypeParameterSymbol).GetNonInterfaceConstraint(useSiteInfo)
3674conv = ClassifyConversionFromTypeParameter(DirectCast(source, TypeParameterSymbol), destination, varianceCompatibilityClassificationDepth, useSiteInfo)
3682conv = ClassifyConversionToTypeParameter(source, DirectCast(destination, TypeParameterSymbol), varianceCompatibilityClassificationDepth, useSiteInfo)
3698typeParameter As TypeParameterSymbol,
3709Dim queue As ArrayBuilder(Of TypeParameterSymbol) = Nothing
3720typeParameter As TypeParameterSymbol,
3722<[In], Out> ByRef queue As ArrayBuilder(Of TypeParameterSymbol),
3851queue = ArrayBuilder(Of TypeParameterSymbol).GetInstance()
3855queue.Add(DirectCast(constraint, TypeParameterSymbol))
3896typeParameter As TypeParameterSymbol,
Symbols\ConstraintsHelper.vb (27)
24Public Sub New(typeParameter As TypeParameterSymbol, useSiteInfo As UseSiteInfo(Of AssemblySymbol))
29Public Sub New(typeParameter As TypeParameterSymbol, diagnostic As DiagnosticInfo)
33Public Sub New(typeParameter As TypeParameterSymbol, constraint As TypeParameterConstraint, diagnostic As DiagnosticInfo)
38Public ReadOnly TypeParameter As TypeParameterSymbol
96typeParameter As TypeParameterSymbol,
98inProgress As ConsList(Of TypeParameterSymbol),
223Dim constraintTypeParameter = DirectCast(constraintType, TypeParameterSymbol)
603typeParameters As ImmutableArray(Of TypeParameterSymbol),
632typeParameter As TypeParameterSymbol,
688typeParameter As TypeParameterSymbol,
729Public Function GetNonInterfaceConstraint(typeParameter As TypeParameterSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As TypeSymbol
741candidate = DirectCast(constraint, TypeParameterSymbol).GetNonInterfaceConstraint(useSiteInfo)
763Public Function HasInterfaceConstraint(typeParameter As TypeParameterSymbol) As Boolean
772If DirectCast(constraint, TypeParameterSymbol).HasInterfaceConstraint() Then
796Public Function GetClassConstraint(typeParameter As TypeParameterSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As NamedTypeSymbol
825typeParameter As TypeParameterSymbol,
838DirectCast(type, TypeParameterSymbol).GetAllConstraints(constraintsBuilder, If(fromConstraintOpt.HasValue, fromConstraintOpt.Value, constraint))
850New TypeParameterAndConstraint(DirectCast(fromConstraintOpt.Value.TypeConstraint, TypeParameterSymbol), constraint.AtLocation(fromConstraintOpt.Value.LocationOpt)),
861Public Sub New(typeParameter As TypeParameterSymbol, constraint As TypeParameterConstraint, Optional isBad As Boolean = False)
867Public ReadOnly TypeParameter As TypeParameterSymbol
900typeParameter As TypeParameterSymbol,
911If DirectCast(typeArgument, TypeParameterSymbol).HasConstructorConstraint OrElse typeArgument.IsValueType Then
950typeParameter As TypeParameterSymbol,
970typeParameter As TypeParameterSymbol,
1082Dim typeParameter = DirectCast(type, TypeParameterSymbol)
1096Private Function GetConstraintCycleInfo(cycle As ConsList(Of TypeParameterSymbol)) As CompoundDiagnosticInfo
1098Dim previous As TypeParameterSymbol = Nothing
Symbols\ReducedExtensionMethodSymbol.vb (19)
24Private ReadOnly _fixedTypeParameters As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeSymbol))
57Dim hashSetOfTypeParametersToFix As New HashSet(Of TypeParameterSymbol)
61Dim typeParametersToFixArray As ImmutableArray(Of TypeParameterSymbol) = Nothing
79For Each typeParameter As TypeParameterSymbol In hashSetOfTypeParametersToFix
118Dim typeParametersToFix = ArrayBuilder(Of TypeParameterSymbol).GetInstance(toFixCount)
181Dim fixedTypeParameters = ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeSymbol)).Empty
184Dim fixed = ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeSymbol)).GetInstance(typeParametersToFixArray.Length)
187fixed.Add(New KeyValuePair(Of TypeParameterSymbol, TypeSymbol)(typeParametersToFixArray(i), fixWithArray(i)))
201fixedTypeParameters As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeSymbol)),
228Dim fixed As KeyValuePair(Of TypeParameterSymbol, TypeSymbol) = fixedTypeParameters(i)
262Friend Overrides ReadOnly Property FixedTypeParameters As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeSymbol))
268Public Overrides Function GetTypeInferredDuringReduction(reducedFromTypeParameter As TypeParameterSymbol) As TypeSymbol
277For Each pair As KeyValuePair(Of TypeParameterSymbol, TypeSymbol) In _fixedTypeParameters
304For Each pair As KeyValuePair(Of TypeParameterSymbol, TypeSymbol) In _fixedTypeParameters
363Public Overrides ReadOnly Property TypeParameters As ImmutableArray(Of TypeParameterSymbol)
365Return StaticCast(Of TypeParameterSymbol).From(_curriedTypeParameters)
680Private ReadOnly _curriedFromTypeParameter As TypeParameterSymbol
683Public Sub New(curriedMethod As ReducedExtensionMethodSymbol, curriedFromTypeParameter As TypeParameterSymbol, ordinal As Integer)
707Public Overrides ReadOnly Property ReducedFrom As TypeParameterSymbol
Symbols\TypeSubstitution.vb (33)
73Private ReadOnly _pairs As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers))
85Public ReadOnly Property Pairs As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers))
95Public ReadOnly Property PairsIncludingParent As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers))
100Dim pairBuilder = ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).GetInstance()
108Private Sub AddPairsIncludingParentToBuilder(pairBuilder As ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)))
129Public Function GetSubstitutionFor(tp As TypeParameterSymbol) As TypeWithModifiers
187Public Function GetTypeArgumentsCustomModifiersFor(originalDefinition As TypeParameterSymbol) As ImmutableArray(Of CustomModifier)
342Return Concat(sub1, targetGenericDefinition, ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).Empty)
369params() As TypeParameterSymbol,
378params() As TypeParameterSymbol,
397params As ImmutableArray(Of TypeParameterSymbol),
413Dim pairs = ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).GetInstance()
416Dim param As TypeParameterSymbol = params(i)
450pairs.Add(New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(param, arg))
463currentParent = Concat(currentParent, targetGenericDefinition, ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).Empty)
484params As ImmutableArray(Of TypeParameterSymbol),
513pairs As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers))
526Concat(parent, containingType, ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).Empty))
556Private Sub New(targetGenericDefinition As Symbol, pairs As ImmutableArray(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)), parent As TypeSubstitution)
594Dim typeParametersDefinitions As ImmutableArray(Of TypeParameterSymbol)
606Dim pairs(typeParametersDefinitions.Length - 1) As KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)
611pairs(i) = New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(typeParametersDefinitions(i), New TypeWithModifiers(alphaRenamedTypeParameters(i)))
635Dim typeParametersDefinitions As ImmutableArray(Of TypeParameterSymbol) = targetMethod.TypeParameters
644Dim typeParameter = DirectCast(argument.Type, TypeParameterSymbol)
666Dim pairs(countOfMeaningfulPairs - 1) As KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)
673Dim typeParameter = DirectCast(argument.Type, TypeParameterSymbol)
680pairs(countOfMeaningfulPairs) = New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(typeParametersDefinitions(i), argument)
710Dim pairs = ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).GetInstance()
744pairs As ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)),
780pairs.Add(New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(oldPairs(i).Key, newValue))
812Dim typeParametersDefinitions As ImmutableArray(Of TypeParameterSymbol)
848Dim pairs(significantMaps - 1) As KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)
852pairs(pairIndex) = New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(typeParametersDefinitions(i), args(i))
Symbols\TypeSymbolExtensions.vb (17)
491For Each constraint In DirectCast(this, TypeParameterSymbol).ConstraintTypesWithDefinitionUseSiteDiagnostics(useSiteInfo)
590type As TypeParameterSymbol,
640derivedType = DirectCast(derivedType, TypeParameterSymbol).GetNonInterfaceConstraint(useSiteInfo)
739Friend Sub CollectReferencedTypeParameters(this As TypeSymbol, typeParameters As HashSet(Of TypeParameterSymbol))
743Private ReadOnly s_addIfTypeParameterFunc As Func(Of TypeSymbol, HashSet(Of TypeParameterSymbol), Boolean) = AddressOf AddIfTypeParameter
745Private Function AddIfTypeParameter(type As TypeSymbol, typeParameters As HashSet(Of TypeParameterSymbol)) As Boolean
747typeParameters.Add(DirectCast(type, TypeParameterSymbol))
753Friend Function ReferencesTypeParameterNotInTheSet(this As TypeSymbol, typeParameters As HashSet(Of TypeParameterSymbol)) As Boolean
758Private ReadOnly s_isTypeParameterNotInSetFunc As Func(Of TypeSymbol, HashSet(Of TypeParameterSymbol), Boolean) = AddressOf IsTypeParameterNotInSet
760Private Function IsTypeParameterNotInSet(type As TypeSymbol, typeParameters As HashSet(Of TypeParameterSymbol)) As Boolean
762Not typeParameters.Contains(DirectCast(type, TypeParameterSymbol))
994specializedTypeParameters As ImmutableArray(Of TypeParameterSymbol)
1020newTypeArguments(i) = specializedTypeParameters(DirectCast(typeArgument, TypeParameterSymbol).Ordinal)
1031newTypeArguments(i) = specializedTypeParameters(DirectCast(typeArgument, TypeParameterSymbol).Ordinal)
1160Public Function GetAllTypeParameters(type As NamedTypeSymbol) As ImmutableArray(Of TypeParameterSymbol)
1166Dim builder = ArrayBuilder(Of TypeParameterSymbol).GetInstance()
1176Public Sub GetAllTypeParameters(type As NamedTypeSymbol, builder As ArrayBuilder(Of TypeParameterSymbol))
Utilities\TypeUnification.vb (9)
155Dim tp1 As TypeParameterSymbol = DirectCast(t1.Type, TypeParameterSymbol)
179Dim tp2 As TypeParameterSymbol = DirectCast(t2.Type, TypeParameterSymbol)
206Private Shared Sub AddSubstitution(ByRef substitution As TypeSubstitution, targetGenericType As NamedTypeSymbol, tp As TypeParameterSymbol, typeArgument As TypeWithModifiers)
208Dim substitutionPairs = ArrayBuilder(Of KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)).GetInstance()
214substitutionPairs.Insert(i, New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(tp, typeArgument))
221Dim typeParameters(0 To count - 1) As TypeParameterSymbol
239Private Shared Function Contains(type As TypeSymbol, typeParam As TypeParameterSymbol) As Boolean
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests (3)