UndefinedMemberD4rtException class
Thrown when a member lookup finds no member of that name on the receiver.
This is a control-flow signal, and that is the reason it exists. Eight
sites in each mirrored visitor have to distinguish "the member is genuinely
absent, so try extension-method resolution" from "the member was found and
something inside it failed, so propagate that". Before SCC28 they made that
decision with e.message.contains("Undefined property '$name'") — a
formatted, human-readable diagnostic used as a branch condition. The wording
was therefore load-bearing: rewording it, in either tree, silently disabled
extension methods for every receiver kind routed through the edited site,
with no analyzer error and a wrong answer rather than a crash as the
symptom.
memberName carries what the message used to spell, so the message is free
to change. It is compared exactly (e.memberName == name) where the old code
asked for a substring, which also removes the case where a member whose name
merely appeared in an unrelated diagnostic took the extension branch.
A subtype of RuntimeD4rtException, deliberately. Between a raise site
and the site that inspects it sit roughly forty on RuntimeD4rtException
clauses, most of which only re-wrap and re-throw. Making this a sibling type
would have required changing all of them in one commit; making it a subtype
let the conversion land raise site by raise site, with every intermediate
state working. toString() is inherited too, so the diagnostics are
unchanged to the byte and no message assertion needed rewriting.
Not to be confused with D4rtNoSuchMethodError, which the final lookup
failures raise — the ones reached after extension resolution and any user
noSuchMethod have had their chance. This type marks the intermediate
failures, the ones that are still a question rather than an answer.
- Inheritance
-
- Object
- D4rtException
- RuntimeD4rtException
- UndefinedMemberD4rtException
Constructors
- UndefinedMemberD4rtException(String message, {required String memberName})
Properties
- hasDirectiveContext ↔ bool
-
Whether message already names which module failed to load which target.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- memberName → String
-
The member that was not found. Compared by equality, never parsed.
final
- message → String
-
The error message.
finalinherited
- originalException → Object?
-
When this runtime error wraps a native exception thrown from a bridged
adapter (method, static method, getter, setter, operator, constructor),
the original exception object is preserved here. This lets a typed
on NativeType/ barecatchclause in interpreted code dispatch against the real exception type rather than thisRuntimeErrorwrapper. (OPEN B.5 — U13/U24.)finalinherited - originalStackTrace → StackTrace?
-
The stack trace that accompanied originalException at the point the
bridged adapter threw it.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trackedStackTrace ↔ StackTrace?
-
Stack trace captured by ErrorReporter when tracking is enabled.
getter/setter pairinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
revoke(
) → bool -
Revokes this error from the ErrorReporter.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited