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

Dartc: trying to instantiate a top-level function with new or const should produce only a compile error #3309

Closed
DartBot opened this issue May 30, 2012 · 5 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Milestone

Comments

@DartBot
Copy link

DartBot commented May 30, 2012

This issue was originally filed by ms...@unipro.ru


What steps will reproduce the problem?
Run the following test with dartc:

func() {}

main() {
  new func();
}

What is the expected output? What do you see instead?
Expected a compile-time error.
Actual result: one warning and two compile-time errors:
warning: 'type "func" expected, but "METHOD" found'
1st error: 'no such type "func"'
2nd error: 'New expression does not resolve to a constructor'

What version of the product are you using? On what operating system?
Dartc, r8088. OS Ubuntu 10.04

Please provide any additional information below.
The same applies to instantiating with const.
co19 tests:
Language/10_Expressions/10_Instance_Creation/2_Const_A02_t03.dart
Language/10_Expressions/10_Instance_Creation/1_New_A02_t03.dart

@madsager
Copy link
Contributor

Added Area-Analyzer, Triaged labels.

@danrubel
Copy link

danrubel commented Jun 4, 2012

Added this to the M1 milestone.

@scheglov
Copy link
Contributor

scheglov commented Jun 6, 2012

Set owner to @scheglov.
Added Accepted label.

@scheglov
Copy link
Contributor

scheglov commented Jun 6, 2012

@scheglov
Copy link
Contributor

scheglov commented Jun 8, 2012

@DartBot DartBot added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Jun 8, 2012
@DartBot DartBot added this to the M1 milestone Jun 8, 2012
copybara-service bot pushed a commit that referenced this issue Jan 26, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

args (https://github.com/dart-lang/args/compare/04c9346..a23ea85):
  a23ea85  2023-01-25  Devon Carew  update the publishing script (#232)

dartdoc (https://github.com/dart-lang/dartdoc/compare/ed56883..99df16a):
  99df16a0  2023-01-24  Parker Lougheed  Use a sun for light theme toggle instead of moon (#3309)
  758e1851  2023-01-24  Parker Lougheed  Switch dart:js and some dart:js_util usages to use static interop (#3299)
  9735d895  2023-01-24  dependabot[bot]  Bump github/codeql-action from 2.1.38 to 2.1.39 (#3306)
  f6cd8eb9  2023-01-23  Sam Rawlins  Fix various bits in testing code to comply with new warnings (#3307)

http (https://github.com/dart-lang/http/compare/57c53b0..092bb2d):
  092bb2d  2023-01-25  Brian Quinlan  Create a `package:cronet_http/cronet_http.dart` import (#859)
  a62f5b3  2023-01-24  Brian Quinlan  Create a single top-level lib file. (#858)

intl (https://github.com/dart-lang/intl/compare/3fcc810..946c34c):
  946c34c  2023-01-25  Copybara-Service  Merge pull request #533 from dart-lang:updateVersion
  19b6785  2023-01-20  Moritz  Append `-dev` to current version

sse (https://github.com/dart-lang/sse/compare/be426a2..4e63b08):
  4e63b08  2023-01-25  Kevin Moore  Fix deprecated import to webdriver library (#76)

webdev (https://github.com/dart-lang/webdev/compare/f978b90..a347fa0):
  a347fa0  2023-01-25  Anna Gringauze  Update vm_service to version 10.0.0 (#1917)
  4dd29a5  2023-01-24  Anna Gringauze  Allow dart SDK <4.0.0 (#1913)
  b3db2c9  2023-01-24  Anna Gringauze  Prepare for dart 3.0 alpha changes: Handle SDK layout update (#1907)

Change-Id: I84d827db044f5b0af49b0454fd1d69b0d2ddf692
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

4 participants