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

Local function should not be static #1018

Closed
dgrove opened this issue Jan 2, 2012 · 9 comments
Closed

Local function should not be static #1018

dgrove opened this issue Jan 2, 2012 · 9 comments
Assignees
Milestone

Comments

@dgrove
Copy link
Contributor

dgrove commented Jan 2, 2012

(This is a clone of issue #965, which appears on both dartc and frog)
What steps will reproduce the problem?
Run the following test:
f() {
  static localFunction() {}
}

main() {
  f();
}

What is the expected output? What do you see instead?
Expected: compile-time error
Actual: static warning: no such type "static"

Please provide any additional information below.
The Language Specification in the section 6.1 states: "It is a compile-time error to preface a function declaration with the built-in
identifier static."

@jmesserly
Copy link

Removed Priority-Medium label.
Added Priority-Low label.

@anders-sandholm
Copy link
Contributor

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

@kasperl
Copy link

kasperl commented Jun 12, 2012

For this code we report three errors. We should clean that up and make the error message better.

warning: cannot resolve type static
  static f() => 42;
  ^^^^^^^
warning: cannot resolve type static
  static f() => 42;
  ^^^^^^^
error: cannot resolve f
  print(f());


main() {
  static f() => 42;
  print(f());
}



Set owner to @karlklose.
Removed Priority-Low, FromAreaFrog labels.
Added Priority-Medium, Accepted labels.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Removed this from the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Added this to the M2 milestone.

@kasperl
Copy link

kasperl commented Dec 12, 2012

Removed this from the M2 milestone.
Added this to the M3 milestone.

@anders-sandholm
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@karlklose
Copy link
Contributor

Fixed in r19671.


Added Fixed label.

@dgrove dgrove added this to the M4 milestone Mar 8, 2013
copybara-service bot pushed a commit that referenced this issue Sep 19, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (https://github.com/dart-lang/ecosystem/compare/babf5d1..ed39318):
  ed39318  2023-09-14  Devon Carew  validate a prerelease setup-dart version (#169)
  b3dc96f  2023-09-14  Devon Carew  fix an issue rendering multi-line changelogs (#171)

http (https://github.com/dart-lang/http/compare/e19094a..decefa6):
  decefa6  2023-09-15  Brian Quinlan  Remove invalid status line tests and replace them with valid status line tests (#1018)

native (https://github.com/dart-lang/native/compare/4f4d7c3..a5d8809):
  a5d8809  2023-09-18  Daco Harkes  [native_toolchain_c] Bump version (#140)

tools (https://github.com/dart-lang/tools/compare/1512f3d..63d8267):
  63d8267  2023-09-18  Elias Yishak  Restrict surveys for certain tools (#161)
  5a1fc54  2023-09-14  Devon Carew  validate a pre-release setup-dart action (#160)

webdev (https://github.com/dart-lang/webdev/compare/501ccc2..d7e0d1f):
  d7e0d1ff  2023-09-15  Devon Carew  test the latest setup-dart action (#2233)
  4e231bc3  2023-09-14  Elliott Brooks  Fix copying over `client.dart.js` to `client.js` when build DWDS  (#2232)

Change-Id: Iac8741aed14591402b1c8a3cd33dc00e4648ac0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326720
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants