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

Turn compile-time errors into static warnings #1031

Closed
gbracha opened this issue Jan 3, 2012 · 19 comments
Closed

Turn compile-time errors into static warnings #1031

gbracha opened this issue Jan 3, 2012 · 19 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Milestone

Comments

@gbracha
Copy link
Contributor

gbracha commented Jan 3, 2012

There are a number of situations that are specified to be compile-time errors, but which might be treated as static warnings instead. This would be desirable, because compile-time errors impose a workflow: one must resolve them before moving forward to testing/running the program. It would be more in keeping with the spirit of Dart to "get out of the developer's way".

We should do a systematic sweep of these issues and decide which ones can be liberalized in this fashion.

@iposva-google
Copy link
Contributor

Marked this as blocking #970.

@iposva-google
Copy link
Contributor

Marked this as blocking #972.

@iposva-google
Copy link
Contributor

Marked this as blocking #974.

@iposva-google
Copy link
Contributor

Marked this as blocking #975.

@iposva-google
Copy link
Contributor

Marked this as blocking #976.

@iposva-google
Copy link
Contributor

Marked this as blocking #977.

@iposva-google
Copy link
Contributor

Marked this as blocking #978.

@iposva-google
Copy link
Contributor

Marked this as blocking #980.

@iposva-google
Copy link
Contributor

Gilad, has this sweep been completed?

@gbracha
Copy link
Contributor Author

gbracha commented Mar 16, 2012

No. All discussions that require approval from AAR have been put off to
next week.

@anders-sandholm
Copy link
Contributor

Added this to the M1 milestone.

@gbracha
Copy link
Contributor Author

gbracha commented May 18, 2012

Added Started label.

@gbracha
Copy link
Contributor Author

gbracha commented Jun 8, 2012

Also related are:

issue #3078
issue #3080
issue #3084
issue #3085
issue #3086
issue #3087
issue #3088
issue #3089
issue #3093
issue #3094
issue #3095

@gbracha
Copy link
Contributor Author

gbracha commented Jun 11, 2012

The spec for these is done. Implementation in progress.

@gbracha
Copy link
Contributor Author

gbracha commented Jun 11, 2012

Added Done label.

@gbracha
Copy link
Contributor Author

gbracha commented Jun 20, 2012

One more case of relaxation. Latest version of spec, section 10.10.1 replaces errors with warnings in cases where the class or the constructor is undeclared. Motivation is similar to other cases: do not impose workflow - just warn and make it a dynamic error.

"Let e be a new expression of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) or the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k). It is a static warning if T is not a class or interface accessible in the current scope, optionally followed by type arguments.

If e is of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) it is a static warning if T.id is not the name of a constructor declared by the type T. If e of the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k) it is a static warning if the type T does not declare a constructor with the same name as the declaration of T.
"

2 similar comments
@gbracha
Copy link
Contributor Author

gbracha commented Jun 20, 2012

One more case of relaxation. Latest version of spec, section 10.10.1 replaces errors with warnings in cases where the class or the constructor is undeclared. Motivation is similar to other cases: do not impose workflow - just warn and make it a dynamic error.

"Let e be a new expression of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) or the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k). It is a static warning if T is not a class or interface accessible in the current scope, optionally followed by type arguments.

If e is of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) it is a static warning if T.id is not the name of a constructor declared by the type T. If e of the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k) it is a static warning if the type T does not declare a constructor with the same name as the declaration of T.
"

@gbracha
Copy link
Contributor Author

gbracha commented Jun 20, 2012

One more case of relaxation. Latest version of spec, section 10.10.1 replaces errors with warnings in cases where the class or the constructor is undeclared. Motivation is similar to other cases: do not impose workflow - just warn and make it a dynamic error.

"Let e be a new expression of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) or the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k). It is a static warning if T is not a class or interface accessible in the current scope, optionally followed by type arguments.

If e is of the form new T.id(a1, .., an, xn+1: an+1, …, xn+k: an+k) it is a static warning if T.id is not the name of a constructor declared by the type T. If e of the form new T(a1, .., an, xn+1: an+1, …, xn+k: an+k) it is a static warning if the type T does not declare a constructor with the same name as the declaration of T.
"

@gbracha
Copy link
Contributor Author

gbracha commented Jun 20, 2012

Added

Analyzer issue #3800.
VM issue #3801.
dart2js issue #3802.

@gbracha gbracha added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jun 20, 2012
@gbracha gbracha self-assigned this Jun 20, 2012
@gbracha gbracha added this to the M1 milestone Jun 20, 2012
@kevmoo kevmoo added the type-enhancement A request for a change that isn't a bug label Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Oct 17, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

file (https://github.com/google/file.dart/compare/a18ad1c..7418131):
  7418131  2023-10-11  Parker Lougheed  Remove now unnecessary glob dependency override (#226)

http (https://github.com/dart-lang/http/compare/88ec75e..7240d0a):
  7240d0a  2023-10-11  Brian Quinlan  Remove obsolete pigeon-generated file (#1032)
  827f4fe  2023-10-10  Brian Quinlan  Prepare to release cronet 0.4.0 (#1031)

native (https://github.com/dart-lang/native/compare/22f4481..757f503):
  757f503  2023-10-16  Gabriel Terwesten  Use `Logger.detached` for test loggers (#158)

sse (https://github.com/dart-lang/sse/compare/e190744..37df57d):
  37df57d  2023-10-13  Kevin Moore  Enable and fix latest lints (#91)

test (https://github.com/dart-lang/test/compare/4341470..ba050ae):
  ba050ae2  2023-10-13  Nate Bosch  Move functions to non-deprecated library (#2120)
  96e1ed2d  2023-10-13  Nate Bosch  Remove unused href field from error report (#2118)
  ae7f30e9  2023-10-13  Nate Bosch  Make compiler optional in calls to currentPlatform (#2117)

tools (https://github.com/dart-lang/tools/compare/92c5c15..ddeccf6):
  ddeccf6  2023-10-10  Elias Yishak  Handling malformed log items in log file (#175)

webdev (https://github.com/dart-lang/webdev/compare/7c2c2d7..8d48d5e):
  8d48d5ea  2023-10-13  Ben Konyi  Bump package:vm_service to ^12.0.0 (#2248)
  9102b427  2023-10-13  Anna Gringauze  Add evaluation test to webdev to catch issues with runtime debugging API (#2250)
  63c7e728  2023-10-12  Elliott Brooks  Cider expects messages from a Chrome extension to be a JS object, not a string (#2249)
  a10bf10e  2023-10-11  Devon Carew  regenerate from the latest package:mono_repo (#2247)

Change-Id: I5c16c1387b613d1e6076579b26e6b64735097b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330662
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@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
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants