Skip to content
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

woud love to write annotations with less const noise #24620

Closed
kasperpeulen opened this issue Oct 18, 2015 · 4 comments
Closed

woud love to write annotations with less const noise #24620

kasperpeulen opened this issue Oct 18, 2015 · 4 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report

Comments

@kasperpeulen
Copy link

When porting angular2 typescript examples, I feel like that in many cases the dart syntax is sweeter, except for the const noise you sometimes have with annotations.

I was just trying to make myself a library with annotations, but in this case, it becomes even worse:

  @Test(parameters: const[
    const[1, 1], const[2, 4], const[3, 9], const[4, 16], const[5, 25]
  ])
  math_pow_squares_an_integer(int number, int squared) {
    expect(math.pow(number, 2), squared);
  }

I would love that in future dart version, all those const annotations wouldn't be necessary anymore. Can I have any hope for this?

In my naive point of view, I would say that if the variable must be constant, dart kind of automatic marks the list constant(behind the scenes). And if that is not possible, warn the user? Isn't that also what happens with strings and integers?

@sethladd
Copy link
Contributor

cc @lrhn for fyi

@sethladd sethladd added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label Oct 19, 2015
@zoechi
Copy link
Contributor

zoechi commented Oct 19, 2015

I guess it's a dupe of #4046

@lrhn lrhn added the closed-duplicate Closed in favor of an existing report label Oct 19, 2015
@lrhn
Copy link
Member

lrhn commented Oct 19, 2015

It certainly is a dupe.

I wholeheartedly concur with the request. See: https://github.com/lrhn/dep-const/blob/master/proposal.md

@kasperpeulen
Copy link
Author

@lrhn Nice to see a proposal! What is the status? Is it accepted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

4 participants