Runtime dynamic object/real proxy #23896
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-obsolete
Closed as the reported issue is no longer relevant
type-enhancement
A request for a change that isn't a bug
It is very useful that we can override noSuchMethod and create effective proxies. It would be even more useful if it were possible to create proxies that implement every interface (actual dynamics) when it comes to type checks.
Forwarder is effectively dynamic. Currently, this only works for generic parameters in type checks.
(
print(new List<dynamic>() is List<String>); // prints true
).An alternative would be to provide a way to mixin classes at runtime, but that would seem much more difficult to implement in the VM/dart2js.
Currently, one has to manually create proxies that implement the right interfaces to avoid runtime errors, which does not scale well for writing generic interceptors/loggers/etc.
The text was updated successfully, but these errors were encountered: