C# Class Pchp.CodeAnalysis.Symbols.TypeParameterBounds

The effective "bounds" of a type parameter: the constraint types, effective interface set, and effective base type, determined from the declared constraints, with any cycles removed. The fields are exposed by the TypeParameterSymbol as ConstraintTypes, Interfaces, and BaseType.
Exibir arquivo Open project: iolevel/peachpie Class Usage Examples

Public Properties

Property Type Description
ConstraintTypes ImmutableArray
DeducedBaseType TypeSymbol
EffectiveBaseClass NamedTypeSymbol
Interfaces ImmutableArray
Unset TypeParameterBounds

Public Methods

Method Description
TypeParameterBounds ( ImmutableArray constraintTypes, ImmutableArray interfaces, NamedTypeSymbol effectiveBaseClass, TypeSymbol deducedBaseType ) : System.Collections.Immutable

Private Methods

Method Description
TypeParameterBounds ( ) : System.Collections.Immutable

Method Details

TypeParameterBounds() public method

public TypeParameterBounds ( ImmutableArray constraintTypes, ImmutableArray interfaces, NamedTypeSymbol effectiveBaseClass, TypeSymbol deducedBaseType ) : System.Collections.Immutable
constraintTypes ImmutableArray
interfaces ImmutableArray
effectiveBaseClass NamedTypeSymbol
deducedBaseType TypeSymbol
return System.Collections.Immutable

Property Details

ConstraintTypes public_oe property

The type parameters, classes, and interfaces explicitly declared as constraint types on the containing type parameter, with cycles removed.
public ImmutableArray ConstraintTypes
return ImmutableArray

DeducedBaseType public_oe property

The "exact" effective base type. In the definition of effective base type we abstract some concrete types to their base classes: * For each constraint of T that is a struct-type, R contains System.ValueType. * For each constraint of T that is an enumeration type, R contains System.Enum. * For each constraint of T that is a delegate type, R contains System.Delegate. * For each constraint of T that is an array type, R contains System.Array. * For each constraint of T that is a class-type C, R contains type C' which is constructed from C by replacing all occurrences of dynamic with object. The reason is that the CLR doesn't support operations on generic parameters that would be needed to work with these types. For example, ldelem instruction requires the receiver to be a specific array, not a type parameter constrained to be an array. When computing the deduced type we don't perform this abstraction. We keep the original constraint T. Deduced base type is used to check that consistency rules are satisfied.
public TypeSymbol DeducedBaseType
return TypeSymbol

EffectiveBaseClass public_oe property

As defined in 10.1.5 of the specification.
public NamedTypeSymbol,Pchp.CodeAnalysis.Symbols EffectiveBaseClass
return NamedTypeSymbol

Interfaces public_oe property

The set of interfaces explicitly declared on the containing type parameter and any type parameters on which the containing type parameter depends, with duplicates removed.
public ImmutableArray Interfaces
return ImmutableArray

Unset public_oe static_oe property

public static TypeParameterBounds,Pchp.CodeAnalysis.Symbols Unset
return TypeParameterBounds