Skip to content

frog treats an additive expression with strings literals as a constant expression #1022

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

Closed
dgrove opened this issue Jan 2, 2012 · 2 comments
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue web-dart2js

Comments

@dgrove
Copy link
Contributor

dgrove commented Jan 2, 2012

(cloned from issue #961)

What steps will reproduce the problem?
Run the following test:
class C {
  static final String s = "One" + "Two";
}

main() {
  print(C.s);
}

What is the expected output? What do you see instead?
Expected: compile-time error.
Actual: "OneTwo"

What version of the product are you using? On what operating system?
frogc r2899

Please provide any additional information below.
According to the section 10.1 of the Language Specification, "An expression of one of the forms e1+e2, e1 - e2, e1 * e2, e1 / e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e1 and e2 are constant expressions that evaluate to a numeric value."
can be a constant expression, but an additive expression with string literals can't.

@anders-sandholm
Copy link
Contributor

Removed Area-Frog label.
Added Area-Dart2JS, FromAreaFrog labels.

@kasperl
Copy link

kasperl commented Jun 12, 2012

Added WontFix label.

@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue and removed resolution-wont_fix labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants