UndefinedStaticMemberD4rtException class
Thrown when a STATIC member lookup fails on a class, enum, bridged class or extension.
SCD86. Sibling of UndefinedMemberD4rtException and deliberately NOT the
same type, because the two failures answer different questions: instance-member
absence gates extension-method lookup, static-member absence gates the
compound-assignment fallback in visitAssignmentExpression. Collapsing them
would let one branch answer for the other — the same class of defect SCC28
removed when it stopped those branches reading diagnostic text.
What it replaced was the last message test SCC28 left standing:
e.message.contains("Undefined static member")
That line was less fragile than the ones SCC28 converted — it carried no name
check, so no rename could break it — but it was fragile in a way the source
scan could not see. F-SCC28-1 matched on "Undefined property", so the static
wording passed the scan, and a seventh raise site phrased differently would
have passed it too while silently never taking this branch. The six existing
sites compose four different sentences (on class, on enum, on bridged class, on extension) and every one had to keep starting with those three
words.
memberName carries what the message spells, so the message is free to change. The decision site does not read it, and that is deliberate: the condition it replaced had no name check, so using one here would have narrowed the branch rather than typed it. It is carried for parity with UndefinedMemberD4rtException and so that any future site can ask by equality instead of by substring.
A subtype of RuntimeD4rtException for the reason
UndefinedMemberD4rtException documents: the on RuntimeD4rtException
clauses between raise and inspection stay working, so the conversion could
land site by site.
NOT a NoSuchMethodError, and that is a decision (sce67).
UndefinedMemberD4rtException was given that SDK supertype so a script can
catch a missing INSTANCE member the way it catches real Dart's. This one
was deliberately left out: real Dart rejects Klass.missing at COMPILE
time, so no runtime NoSuchMethodError exists for a script to catch, and
adding one would make d4rt strictly more catchable than the platform — the
mistake D4rtRangeError records for IndexError. Same reasoning as
UndefinedNameD4rtException, different from the instance case because a
d4rt receiver is effectively dynamic and dynamic member access really does
raise at runtime.
- Inheritance
-
- Object
- D4rtException
- RuntimeD4rtException
- UndefinedStaticMemberD4rtException
Constructors
- UndefinedStaticMemberD4rtException(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
- isResolutionFailure → bool
-
Whether this error means A NAME DID NOT RESOLVE — a member, operator,
constructor or variable that the receiver does not have — as opposed to
something failing inside a member that was found.
finalinherited
- memberName → String
-
The static 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