-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Any plans of replacing dynamic
with Object?
, List<int>
with Uint8List
#50874
Comments
Not sure I understand the request about |
Future funcA() => ...;
void funcB(String s) => ...;
funcB(await funcA());
Future<Object> funcX() => ...;
void funcY(String s) => ...;
funcY(await funcX() as String) |
@Wdestroier Au contraire.
I would, however, encourage promoting instead. final x = await funcX();
if (x is String) {
funcY(x);
} This way, we are 100% sure that we won't get an edgy-case runtime error because, for some weird reason, |
Specific changes to individual libraries is always possible. There is no general plan to go over all the libraries and change things. Changing a Changing an argument type from Labeling this as an enhancement request for |
Actually I asked this, because of Dart 3, that its a major version, so the system could be open, for breaking changes |
We can make breaking changes, but it's always a cost/benefit trade-off. If we did the same change as part of a larger "no-implicit- |
Closing per @lrhn comment above regarding cost/benefit trade-off. |
Hello,
Reading
Future func()
seems very bad, compared toFuture<Object> func()
, especially in the code, of a core library (indexed_db
for example), and may depreciate the intent of code quality, towards the language team, among the readers of the code,Also the
RandomAccessFile
class has methods,void writeFromSync(List<int> buffer,
,int readIntoSync(List<int> buffer,
, which operate onList<int>
instead ofUint8List
, although the former is converted into the latter, internally, so are there any plans to replace int list parameters, with byte arrays,Maybe in dart 3,
If not, can there we some member function, like
Uint8List readSync(int count)
, which takes a byte array, for writing to a file, maybe likevoid writeSync(Uint8List bytes)
,Thanking you,
The text was updated successfully, but these errors were encountered: