InterpretedInstance class
Represents an instance of an InterpretedClass at runtime.
- Implemented types
Constructors
-
InterpretedInstance(InterpretedClass klass, {List<
RuntimeType> ? typeArguments})
Properties
- bridgedSuperObject ↔ Object?
-
The native object created by a bridged superclass constructor.
getter/setter pair
- hashCode → int
-
Honour user-defined
hashCodeso that interpreted instances slot into native Dart hash structures consistently with their==. Mirror of tom_d4rtInterpretedInstance.hashCode.no setteroverride - interpretedStatefulWidget ↔ InterpretedInstance?
-
getter/setter pair
- klass → InterpretedClass
-
final
- nativeProxy ↔ Object?
-
getter/setter pair
- nativeStateProxy ↔ Object?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- runtimeTypeValue → Object
-
What the script's
runtimeTypeanswers. ghissues72: an instance created with type arguments answers with them,Box<int>as Dart prints it, equal to another instance's of the same class and arguments only (InterpretedGenericType). A non-generic instance, and one whose arguments are the class's defaults (Box(), which the interpreter fills withdynamic, or a parameter's bound), answers with its class, as before: in Dart the literalBoxdenotes exactly that type, soBox().runtimeType == Boxholds. It printsBoxwhere Dart printsBox<dynamic>.no setter -
superCallNamedArgs
↔ Map<
String, Object?> ? -
getter/setter pair
-
superCallPositionalArgs
↔ List<
Object?> ? -
getter/setter pair
- thrownStackTrace ↔ StackTrace?
-
The stack trace recorded when this instance was first thrown, for an
instance whose bridged super-object is an Error (SCF39).
getter/setter pair
-
typeArguments
→ List<
RuntimeType> ? -
final
- valueType → RuntimeType
-
The runtime type of this value.
no setteroverride
Methods
-
bindMethodCached(
InterpretedFunction method) → Callable -
Returns the bound tear-off of
methodfor this instance, allocating it once and reusing it on subsequent accesses. See_boundMethodCache. -
collectionShape(
InterpreterVisitor? visitor) → Object? -
ghissues77: the native object that gives this instance its shape - the
native super-object, else the receiver proxy of a
dart:collectionbase orIterableon its class chain (anIterableBasesubclass is read, printed andis-checked as the iterable its proxy is). Null when it has neither. -
defaultToStringOver(
Object native) → String? -
This instance's own default rendering when
native— its bridged super-object or proxy — answersObject's defaulttoString, and null whennativeoverrides it (ArgumentError's message is a real answer). -
findOperator(
String operatorSymbol) → InterpretedFunction? -
get(
String name, {InterpreterVisitor? visitor}) → Object? -
Accesses a property or method of this value.
override
-
getField(
String name) → Object? -
getForAccess(
String name, {required InterpreterVisitor visitor}) → Object? -
get for an explicit property read
x.name: a static member is not reachable through an instance in Dart (ghissues77; Slang'sstatic get currentLocale => instance.currentLocale, whose instancecurrentLocaleis inherited, read the static itself). -
getForInvocation(
String name, {required InterpreterVisitor visitor}) → Object? -
get for the callee of a method invocation
x.name(...). -
getTypeArguments(
) → List< RuntimeType> ? - Get the generic type arguments for this instance
-
hasInstanceMember(
String name) → bool -
Non-throwing check: does this instance declare an instance member
(field, getter, or method) named
name? -
invokeNoSuchMethod(
InterpreterVisitor visitor, Invocation invocation) → Object? -
ghissues46: answers
invocation- a member this instance's class does not have - with itsnoSuchMethod: an interpreted one, else the one a bridged superclass or mixin declares, run on the native object. Returns noNoSuchMethod when the class has neither (Object's noSuchMethod: the caller reports the miss). -
isValueCompatibleWithTypeArgument(
Object? value, int typeArgumentIndex) → bool - Check if a value is compatible with the expected generic type at the given index
-
nativeReceiverFor(
String bridgedTypeName, InterpreterVisitor? visitor) → Object? -
The native object a member inherited from the bridged class
bridgedTypeNameruns on: the native super-object, else the native proxy, else a receiver proxy for that class (D4.markProxyIsReceiver, ghissues25). Null when there is none. -
noReceiverError(
String bridgedName, String member) → RuntimeD4rtException -
ghissues31: the error for a member this instance's class inherits from
the bridged class
bridgedNamewhen there is no native object to run it on - neither a native super-object nor a native or receiver proxy. It used to answer null silently (RC-9). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
objectMember(
String name) → Object? -
What
Objectitself answers fornameon this instance, or null whennameis not one ofObject's members that can be asked of an instance by name. -
recordThrowIfError(
StackTrace stackTrace) → void - Records thrownStackTrace if this is the first throw of an instance extending Error; a later throw keeps the first, as Dart does.
-
set(
String name, Object? value, [InterpreterVisitor? visitor]) → void -
Sets a property of this value.
override
-
toString(
) → String -
Dispatches to the script's
toString()when there is one, and falls back to_diagnosticStringotherwise.override -
validateFieldAssignment(
String fieldName, Object? value, RuntimeType? expectedType) → void - Validate that a value can be assigned to a field with a specific generic type constraint
Operators
-
operator ==(
Object other) → bool -
Honour user-defined
==so that interpreted instances compare correctly inside native Dart collections (e.g.Set<Cell>,Map<Cell, …>).override
Constants
- noNoSuchMethod → const Object
- What invokeNoSuchMethod returns when the class has no noSuchMethod of its own.