language
language copied to clipboard
[Wildcard Variables][spec] Late wildcard variables
(Pretty small thing, but I wanted to make sure we tracked this.)
What do we want to do with late wildcard variables? What does this combo even mean? Do we want to provide a warning on the late modifier?
late int _;
late int _ = 2;
cc. @dart-lang/language-team
We don't have to special-case it. If we don't, it means precisely what it looks like: A late variable with no name to refer to it.
That makes it useless. No more useless than int _(int x) => x;
or const _ = Banana();
, and no less.
We generally haven't tried to disallow places where declaring something names _
is "useless". That would require us to define "useless", which is always precarious.
Note the overlap with https://github.com/dart-lang/language/issues/3798.
Good call @eernstg. Didn't see that issue. Closing this one.