InterpretedClass class
Represents a class definition at runtime.
- Implemented types
Constructors
-
InterpretedClass(String name, InterpretedClass? superclass, Environment classDefinitionEnvironment, List<
SFieldDeclaration> fieldDeclarations, Map<String, InterpretedFunction> methods, Map<String, InterpretedFunction> getters, Map<String, InterpretedFunction> setters, Map<String, InterpretedFunction> staticMethods, Map<String, InterpretedFunction> staticGetters, Map<String, InterpretedFunction> staticSetters, Map<String, Object?> staticFields, Map<String, InterpretedFunction> constructors, Map<String, InterpretedFunction> operators, {bool isAbstract = false, List<InterpretedClass> ? interfaces, bool isMixin = false, List<RuntimeType> ? onClauseTypes, List<InterpretedClass> ? mixins, List<BridgedClass> ? bridgedMixins, List<BridgedClass> ? bridgedInterfaces, bool isFinal = false, bool isInterface = false, bool isBase = false, bool isSealed = false, BridgedClass? bridgedSuperclass, List<String> typeParameterNames = const [], Map<String, RuntimeType?> typeParameterBounds = const {}})
Properties
- arity → int
-
no setteroverride
-
bridgedInterfaces
↔ List<
BridgedClass> -
getter/setter pair
-
bridgedMixins
↔ List<
BridgedClass> -
getter/setter pair
- bridgedSuperclass ↔ BridgedClass?
-
getter/setter pair
-
bridgedSuperTypeArgNames
↔ List<
String> ? -
Names of the type arguments supplied to bridgedSuperclass in the
script's
extendsclause (e.g.['RRect']forclass W extends CustomClipper<RRect>).getter/setter pair - classDefinitionEnvironment → Environment
-
final
-
constructors
→ Map<
String, InterpretedFunction> -
final
- declaringVisitor ↔ InterpreterVisitor?
-
The visitor that declared this class, kept so a script's own
toString()override can still be dispatched after the interpreter has unwound.getter/setter pair -
doubleFieldNames
→ Set<
String> -
ghissues32: the instance fields declared
double/double?in this class, its superclasses and its mixins - the fields anintwidens in. Computed on first use (instances are created after every class of the library is declared, so the hierarchy is complete by then) and kept.no setter -
fieldDeclarations
→ List<
SFieldDeclaration> -
final
-
getters
→ Map<
String, InterpretedFunction> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasNonTrivialNoSuchMethod → bool
-
ghissues46: whether this class has a
noSuchMethodother than Object's - declared here, by a mixin or a superclass, or by a bridged superclass or bridged mixin. Dart then gives the class a forwarder for every member its interfaces and abstract superclasses leave unimplemented, so it is a complete implementation of them.no setter -
interfaces
↔ List<
InterpretedClass> -
getter/setter pair
- isAbstract → bool
-
final
- isBase → bool
-
final
- isFinal → bool
-
final
- isInterface → bool
-
final
- isMixin → bool
-
final
- isSealed → bool
-
final
-
methods
→ Map<
String, InterpretedFunction> -
final
-
mixins
↔ List<
InterpretedClass> -
getter/setter pair
- name → String
-
The name of the type.
final
-
onClauseTypes
↔ List<
RuntimeType> -
getter/setter pair
-
operators
→ Map<
String, InterpretedFunction> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
setters
→ Map<
String, InterpretedFunction> -
final
-
staticFields
→ Map<
String, Object?> -
final
-
staticGetters
→ Map<
String, InterpretedFunction> -
final
-
staticMethods
→ Map<
String, InterpretedFunction> -
final
-
staticSetters
→ Map<
String, InterpretedFunction> -
final
- superclass ↔ InterpretedClass?
-
getter/setter pair
-
typeParameterBounds
→ Map<
String, RuntimeType?> -
final
-
typeParameterNames
→ List<
String> -
final
Methods
-
bindsInterfaceMember(
String name) → bool -
Returns a map representing all members required by the interfaces implemented
by this class and its superclasses, including those from super-interfaces.
Key: member name, Value: String indicating type ('method', 'getter', 'setter')
ghissues71: whether the interface member
namebinds this class. A library's_members are private to it, so they are part of the interface only for a class of the same library: string_scanner'sSpanScanner implements LineScannerneed not implement LineScanner's_adjustLineAndColumn. A public name always binds. The library is the environment a class was declared in, which its library's parts share. -
bridgedNoSuchMethodSource(
) → BridgedClass? -
ghissues46: the bridged class (a superclass or a mixin on the chain)
whose
noSuchMethodan instance of this class answers a missing member with when no interpreted class on the chain declares one. -
bridgedProvides(
String name, InterpreterVisitor? visitor) → bool -
ghissues77: whether a bridged superclass or bridged mixin on this
class's chain provides the member
name(with the bridge's registered supertypes): package collection'sEmptyUnmodifiableSet extends IterableBase<E> ... implements UnmodifiableSetView<E>getsmapand the rest of the interface fromIterableBase. -
call(
InterpreterVisitor visitor, List< Object?> positionalArguments, [Map<String, Object?> namedArguments = const {}, List<RuntimeType> ? typeArguments]) → Object? -
override
-
createAndInitializeInstance(
InterpreterVisitor visitor, List< RuntimeType> ? typeArguments) → InterpretedInstance -
findConstructor(
String name) → InterpretedFunction? -
findInstanceGetter(
String name) → InterpretedFunction? -
findInstanceMethod(
String name) → InterpretedFunction? -
findInstanceSetter(
String name) → InterpretedFunction? -
findOperator(
String operatorSymbol) → InterpretedFunction? -
findStaticGetter(
String name) → InterpretedFunction? -
findStaticMethod(
String name) → InterpretedFunction? -
findStaticSetter(
String name) → InterpretedFunction? -
freezeMemberTables(
) → void -
Freezes the per-class function tables once declaration wiring is done
(perf T6). Call this at the end of the Pass-2 member loop, after every
method/getter/setter/operator/static/constructor has been registered.
staticFieldsis intentionally excluded — static-field initialization is deferred (Bug-43 forward references) and mutates that map after this call. -
getAbstractInheritedMembers(
) → Map< String, InterpretedFunction> - Returns a map of all abstract members (methods, getters, setters) inherited from superclasses. The key is the member name, the value is the abstract InterpretedFunction.
-
getAllConcreteMembers(
) → Map< String, InterpretedFunction> -
Returns a map of all concrete instance members (methods, getters, setters)
available on this class, including those inherited via the
extendschain. Key: member name, Value: the concrete InterpretedFunction. -
getAllInterfaceMembers(
) → Map< String, String> -
getConcreteMembers(
) → Map< String, InterpretedFunction> - Returns a map of all concrete instance members (methods, getters, setters) defined directly in this class AND in applied mixins. The key is the member name, the value is the concrete InterpretedFunction. Also includes instance fields (which implicitly provide getters).
-
getInstanceFieldNames(
) → Set< String> - Returns a set of all instance field names in this class and its superclass chain. Fields implicitly provide getters (and setters for non-final fields). G-DOV2-6 FIX: Walk the superclass chain to find fields from parent classes.
-
getStaticField(
String name) → Object? -
isSubtypeOf(
RuntimeType other, {Object? value}) → bool -
Whether this class is a subtype of
other:otheritself, or a type reached throughextends,withorimplements, at any depth.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
providesMember(
String name, InterpreterVisitor? visitor) → bool -
ghissues77: whether this class has
namewithout declaring it - fromObject(an interface that declarestoStringconcretely, package collection'sDelegatingSet, asks nothing of an implementing class), or from a bridged superclass or mixin (bridgedProvides). -
resolveDeferredTypeParameterBounds(
STypeParameterList? typeParameters, Environment enclosing) → void - SCE130: resolve any bound pass 1 had to leave unresolved.
-
setStaticField(
String name, Object? value) → void -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
extractTypeParameterBounds(
STypeParameterList? typeParameters, Environment? resolveEnvironment, {bool lenient = false}) → Map< String, RuntimeType?> -
SCE130:
lenientrecords an unresolvable bound asnullrather than rethrowing. Pass 1 passes it, and resolveDeferredTypeParameterBounds repairs the miss in pass 2 once imports and type aliases exist. -
extractTypeParameterNames(
STypeParameterList? typeParameters) → List< String> -
resolveTypeAnnotationDynamic(
SAstNode typeNode, Environment env) → RuntimeType
Constants
-
objectMemberNames
→ const Set<
String> -
The members every class has from
Object.