-
Notifications
You must be signed in to change notification settings - Fork 24
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
Consider using num
instead of double
for parameter types
#57
Comments
Closes dart-lang#57 Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.
Closes dart-lang#57 Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.
Closes dart-lang#57 Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.
Closes dart-lang#57 Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.
Closes dart-lang#57 Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.
Closes #57 Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.
Reopening due to concerns around users accidentally downcasting A compromise here to:
is to keep the parameter types as |
I also think this might be worth reevaluating to some extent. My feeling is that today's Dart developers aren't as familiar with Cases passing int literals would keep working with |
I agree. I want to perhaps include this in the next major release (which we'll certainly have as we tackle other issues). It does mean a little bit of pain for migration, but it should be minimal.
Most developers aren't aware of the number differences partly because it derives from a web vs native difference. Now that we have the number difference within web, this will pop up more often. |
Closes dart-lang#57 In cases where the return type is known to be a double value, prefer double over num so users don't try and downcast the type, which won't work consistently on all compilers. In order to do this, _typeReference is amended to take an extra option 'returnType' which determines if the `_RawType` is used in a return type context.
This is more backwards compatible with types used in dart:html, and hence less work to adapt a call that used to pass num or int arguments.
The text was updated successfully, but these errors were encountered: