-
Notifications
You must be signed in to change notification settings - Fork 27
fields that implement extension members don't work #548
Comments
(also I think Jacob's fix might address this?) |
I don't think my CL impacts this as I only change behavior for native classes with extensions. |
Here's another example I'm seeing (with same main() {
dynamic x = new MyList();
print(x.isEmpty);
} This prints |
ah chatted about that example, it's probably the same issue. Any ListBase/Mixin that uses a There's also a related issue that "length" shows up twice in the defineExtensionMembers list (probably once from the getter and once from the setter) |
Found a workaround, lowering back to P2. This may be a different bug - changing import 'dart:collection';
class MyList extends ListBase with ListMixin {
int get length => 4;
void set length(int x) {}
int operator[](int x) => 42;
void operator[]=(int x, val) {}
}
main() {
dynamic x = new MyList();
print(x.isEmpty);
} |
Ok, syncing up and now the getter version works. Sorry for the noise. |
Split from #520
The following test fails, because defineExtensionMember does not find a property descriptor for MyList.length, so it does not create
[dartx.length]
and thus ListMixin.forEach will throw.The text was updated successfully, but these errors were encountered: