You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support better representation of extension types in the debugger #53461
We don't currently show much useful information in the debugger for the extension types, as they don't exist at runtime.
Providing a useful experience would require bigger changes though the whole tooling ecosystem:
Design: describe how we present the static extension types to the user in the debugger UI
CFE (incremental compiler), frontend server, expression compiler worker: provide static types to the expression evaluation API.
vm service, vm, dwds: use the new API
DevTools: present static types and using new vm service API
voidmain(List<String> arguments) {
var e1 =E1.foo; // e1 = E1 (E1.foo)var e2 =E2.foo; // e2 = 1
}
enumE1 { foo, bar }
extension typeconstE2._(int index) {
staticconstE2 foo =E2._(0);
staticconstE2 bar =E2._(1);
// Extension types can't declare members with the same name as a member declared by 'Object'.// Try specifying a different name for the member.// dart(extension_type_declares_member_of_object)// @override// String toString() => 'E2.$value';
}
Perhaps Dart could do something like C#'s DebuggerDisplayAttribute - an attribute which lets you specify how debuggers should display a value, which has higher precedence than toString()?
Activity
loic-sharma commentedon Oct 9, 2026
The Flutter team is working on guidance for "open enums": flutter/rfc#32
Unfortunately, extension types impact debuggability:
Perhaps Dart could do something like C#'s
DebuggerDisplayAttribute- an attribute which lets you specify how debuggers should display a value, which has higher precedence thantoString()?Example strawman: