Commit Graph

28 Commits

Author SHA1 Message Date
Jens Johansen aaff0b67f0 [CFE] Enable 'unrelated_type_equality_checks' lint
Change-Id: I9cf739ca6e08203f1c2a33c680193777aef5c0c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 11:22:27 +00:00
Jens Johansen 9552646dc4 [CFE] First batch of fixes for requiring explicit types
Change-Id: Ic27f8508bc95409a5ee8f90b72f34a73d0f8e2e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113034
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-15 13:13:20 +00:00
Jens Johansen cae08c6813 [CFE] Apply lines_longer_than_80_chars lint
Change-Id: I35b62b34d3ccc7098c21a680a80612c0bb927123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113030
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-15 10:01:20 +00:00
Jens Johansen 3921ae1ee1 [CFE] Enable a number of linters
Change-Id: Ib4c78a6a72ede16c16780496cb779a8afe87ed4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113029
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-15 07:47:04 +00:00
Jens Johansen c4727fddf4 [CFE] Apply unawaited_futures lint
Change-Id: I1d783a883c7be84f743724d9eaadc390f84d4b33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113028
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-14 13:42:13 +00:00
Jens Johansen 56c3cfe34c [CFE] Apply prefer_adjacent_string_concatenation lint
Change-Id: I14b3f5060d1eda6a8ea1e0c808593a57f821a725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113026
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-14 13:00:53 +00:00
Jens Johansen 48af666c9f [CFE] apply curly_braces_in_flow_control_structures lint
Change-Id: Id6c7e60b40f7dd0ffd68d007fe86abb785ac0dba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113025
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-14 13:00:44 +00:00
Jens Johansen 574c4a51c6 [CFE] Initial support for parsing language version from .packages
If the .packages file specifies a fragment on a uri on the form
"dart=x.y", x.y becomes the default lanaguage version for libraries in
that package.

Change-Id: I69cb4157fdf5852184cc3519b033c3624792f783
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112082
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-06 12:42:47 +00:00
Paul Berry 2cac8637d6 Flow analysis: separate nullability and reachability tests.
Change-Id: I875493ff504f094ade2818f29539525fdd75a808
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-05 22:12:26 +00:00
Johnni Winther bd8f7aeebb [cfe] Add DeclarationKind to DeclarationBuilder
The prepares for special-casing methods in extension declarations
during building of the outline. This is needed to add synthesized
type parameters and parameters to the method signature.

Change-Id: Id41d85d86a9ad4eedc4a4ce346ad14e18277dda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111728
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-05 17:15:37 +00:00
Jens Johansen a69c81ac34 Id testing for directories with .packages etc
We should also be able to test for larger examples, so this CL adds
support for directories where all files are included. If the directory
contains a .packages file that is used so we can test packages too.

Change-Id: Iceda03505575bd9e5604a6e374b7f5fa7185a82e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111421
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-01 09:25:28 +00:00
Paul Berry 6c1523410f Flow analysis: Create definite assignment test cases.
The test cases are based on
pkg/analyzer/test/src/dart/resolution/definite_assignment_test.dart,
however those tests are removed because they exercise the old definite
assignment logic (which was never hooked up to the rest of the
analyzer, and was abandoned in favor of flow analysis).  This CL also
removes the old definite assignment logic itself.

There are two behavioral regressions compared to the old definite
assignment logic:

- Assignments inside assert bodies are erroneously assumed to always
  execute (they don't, because assertions may be disabled).

- Flow analysis does not yet understand that a function may be known
  to never return (with NNBD, such a function would have a return type
  of Never).

These regressions have been flagged with TODO comments (in the test
files assert.dart and if.dart respectively), and will be addressed in
later CLs.

Change-Id: I4a3923f667b151fe31cdcca69373ee1f8fb85607
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110400
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-31 13:55:54 +00:00
Paul Berry 7557a14a74 Move test cases from type_promotion_test.dart into front end.
We still verify that the analyzer passes these tests, but we now do
the verification using the "ID test" mechanism that's shared with the
CFE.  This will allow the front end to run these tests as soon as its
integration with flow analysis is complete.

Change-Id: I1a7e5ef9698ebac72a72d992f4d765723224fc95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110343
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-31 13:55:54 +00:00
Paul Berry bf4bde6ea2 Move test cases from flow_analysis_test.dart into front end.
We still verify that the analyzer passes these tests, but we now do
the verification using the "ID test" mechanism that's shared with the
CFE.  This will allow the front end to run these tests as soon as its
integration with flow analysis is complete.

Still to do: migrate tests of type promotion and definite assignment
so that they can be shared by the front end.

Change-Id: I3c2ac6ff8b66e3a27110dcdb1f1d2dece447c18d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-07-24 20:20:09 +00:00
Johnni Winther b3b6533c3d [cfe] Create ClassBuilder for extension declarations
Change-Id: Ic372b89588ed9ec3afc43f7db7e3d38a81846ad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109264
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-07-22 16:00:28 +00:00
Peter von der Ahé 52bd3d9159 Complain about use of deprecated members
Change-Id: I76a66cb143027bed83fe6df3c5f19c8a7879a4ca
Reviewed-on: https://dart-review.googlesource.com/c/91926
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-02-05 09:09:04 +00:00
Sam Rawlins 3154bb0d37 Stop using external deprecated members in front_end
Change-Id: I3fa03de568f72bfc3adb46efcfa2b61b781c706b
Reviewed-on: https://dart-review.googlesource.com/c/89020
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-15 18:55:10 +00:00
Sam Rawlins c54bc11770 Split DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE off; fixes #30084 and
fixes https://github.com/dart-lang/linter/issues/1349

Bug: https://github.com/dart-lang/sdk/issues/30084
Change-Id: I4954b883c1baf019a62776fec108eac60960b22e
Reviewed-on: https://dart-review.googlesource.com/c/88881
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-15 03:25:27 +00:00
Devon Carew d53b034a64 Fix several analysis lints.
Change-Id: If7921d5cfc3dd2af79699f9905d7f3b106254cd0
Reviewed-on: https://dart-review.googlesource.com/c/81722
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-26 21:41:35 +00:00
Peter von der Ahé ff70ea2fd5 Update analysis options
Change-Id: I40237c72d0fdb7ab8143dbb8236a3b7d58f63128
Reviewed-on: https://dart-review.googlesource.com/73881
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-07 09:10:37 +00:00
Jenny Messerly 3320d8f677 fix #31237, missing return hint was missing for inferred returns
Change-Id: I3c8c59f31196b220aaa0421f8357a950ff16ba20
Reviewed-on: https://dart-review.googlesource.com/62727
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-07-19 00:19:24 +00:00
Devon Carew 11e001595a Update analysis options files.
Change-Id: I06b659b5ee7105d3f11343259f787194f1d2bd79
Reviewed-on: https://dart-review.googlesource.com/63501
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-07-03 00:20:06 +00:00
Leaf Petersen 4270b99d75 Fix dynamic as bottom uses in front end and dart2js.
Re-enable the dynamic as bottom hint in analysis_options.yaml and fix
the code to be hint clean again.

Fixes #30589
Fixes #30590

Bug:
Change-Id: Idb7910b3ab1c6d931a3ead3eed885d8bd172e621
Reviewed-on: https://dart-review.googlesource.com/17062
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-30 19:54:26 +00:00
Paul Berry d9de63eb81 Disable supermixin support in front end and kernel.
Supermixin support is not currently planned for the initial release of
Dart 2.0, so it seems unwise for front end and kernel to enable it.

Kernel didn't actually contain any usages of supermixin support; front
end contained one usage in a test.

Change-Id: I2b225f8d6c5f0ea32cb60d7636e043c89439548c
Reviewed-on: https://dart-review.googlesource.com/3020
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-04 18:50:17 +00:00
Leaf Petersen 05af4fb787 Disable fuzzy arrow hints in front_end and dart2js
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3004143002 .
2017-08-31 12:17:47 -07:00
Peter von der Ahé 2d9956a93d Move kernel baseline tests to front_end.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2825063002 .
2017-04-19 10:57:58 +02:00
Peter von der Ahé 5bdc1199ca Fix dart2js warnings and add test to ensure it stays clean.
Filed https://github.com/dart-lang/sdk/issues/29224 to track all the problems that require ignore.

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2791993002 .
2017-04-03 15:08:40 +02:00
Peter von der Ahé ccf7597fb5 Rename analyzer options file.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2756243002 .
2017-03-22 12:19:26 +01:00