AppliedRuntimeType class
Runtime model of a generic type applied to concrete type arguments, such as
Box<int> or List<String>. Preserves the applied type arguments at
runtime so is Box<int> and generic/collection return-type checks can
compare the arguments element-wise instead of collapsing to the raw base
type. Ports the applied-runtime-types half of upstream 1042fff.
Subtyping is base-then-arguments: the baseTypes must be compatible
(wildcard / name-equality / base isSubtypeOf), then each declared type
argument on other is matched against the corresponding argument here. An
other argument named dynamic/Object/void acts as a wildcard. When
other is not itself an AppliedRuntimeType (a raw base type or a
structural function/record type), the comparison falls back to the base type
only — a Box<int> is still a Box, an Object, etc. Differing arities
also stay permissive, so coarsely-resolved (partially-applied) annotations
don't regress.
- Implemented types
Constructors
-
AppliedRuntimeType(RuntimeType baseType, List<
RuntimeType> typeArguments)
Properties
- baseType → RuntimeType
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of the type.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
typeArguments
→ List<
RuntimeType> -
final
Methods
-
isSubtypeOf(
RuntimeType other, {Object? value}) → bool -
Checks if this type is a subtype of
other.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited