-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate TypeSafeWrappers? #588
Comments
As long as we're only supporting Dart 2 (which appears to be the case based on the current pubspec), we can do this much more simply by just using |
Definitely, I just am trying to be nice to users - in my own tests it looks like the type of errors thrown by Dart2 versus thrown currently by the wrappers are not exactly the same. |
How much does that buy us in practice? I don't see how code could ever actually construct a |
Until the VM and Dart2JS enforce strong mode, strong-mode typed lists will not throw. So you could potentially be using |
But if dart2js isn't using strong mode semantics, then |
... given that Dart 2 does this out of the box?
Here's what public APIs package offers today:
DelegatingIterable.typed
DelegatingList.typed
DelegatingMap.typed
DelegatingQueue.typed
DelegatingSet.typed
Here's an example of the implementation of those static methods:
https://github.com/dart-lang/collection/blob/fac9e50be7e61819e66abfd6381d55135b8751d3/lib/src/wrappers.dart#L148-L149
I imagine to avoid churn, we could do the following:
isStrongMode
:.typed
methods to be:When Dart 2 is enabled by default everywhere (Dart2JS/VM/Flutter), remove the
TypeSafeX
wrapper classes, as they will never be used. This should not be a breaking change, strictly.At the same time of above, deprecate the
.typed
methods, because they no longer have value and are misleading, doingis
and.cast
is fine for all users at this point.Thoughts? @lrhn @srawlins @kevmoo
The text was updated successfully, but these errors were encountered: