-
Notifications
You must be signed in to change notification settings - Fork 16
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 providing a const constructor for Version
#97
Comments
What's the use case? |
class SomeClass {
static final Version latestVersion = Version(1, 2, 0);
} Feels more natural to write const for something like this. If it would have been an int or string it would have been mandated const by a lint. And Also, if |
I've personally never really gave much for constness. But I guess there are cases where you need it (eg. for default argument values). Looking at the code, it seems to be the fact that Eg. this simplified thing works
But this does not:
|
Yes, we'd have to make |
Yeah - probably not too bad. We could also consider throwing away the original text representation entirely. Not sure why we want to preserve non-canonical data here - it has bitten us several times on pub.dev. |
I'm not entirely sure what to do with
_text
though.Use case: I'd like to specify the version of things as consts.
(low prio)
The text was updated successfully, but these errors were encountered: