-
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
Math.parse{Int,Double} could be constructors #2868
Comments
This comment was originally written by @seaneagan It might make more sense as static methods in order to be able to handle invalid Strings and nulls intelligently (similar to issue #2870): interface int { interface num { interface double { |
Removed Type-Defect label. |
Removed Area-Language label. |
This comment was originally written by @seaneagan If going the static method route, I think it would be more orthogonal to just always return null on invalid input rather than providing an "ifInvalid" parameter. In any case, the solution should be consistent with issue #2870. |
This issue was originally filed by @seaneagan
It would be more consistent/logical to have Math.parseInt and Math.parseDouble as constructors:
interface int {
int.parse(String s); // could use "fromString" but it's a bit long
//...
}
interface num {
num.parse(String s);
//...
}
interface double {
double.parse(String s);
//...
}
The text was updated successfully, but these errors were encountered: