Commit Graph

51 Commits

Author SHA1 Message Date
Fedor Shcheglov 318aeb322b Deprecate DartType.element3, use element instead.
Change-Id: Idef9da09c565a05fa84869f7433df3c24c6fbb5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435521
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-24 07:23:11 -07:00
Sam Rawlins f51d37e9b1 analyzer: Rename ErrorReporter to DiagnosticReporter
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I84b095199773040fc0444364964654c4373a9d77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433740
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-06-10 12:24:34 -07:00
Sam Rawlins 903d77cc82 analyzer: Rename ErrorListener classes to DiagnosticListener
Work towards https://github.com/dart-lang/sdk/issues/60635

I tried to keep this minimal but still sensible:

* Rename AnalysisErrorListener and all subtypes to use 'Diagnostic'.
* Rename all instantiations of such classes if they previously
  contained the word 'error'.
* Rename `RecordingDiagnosticListener.errors` to `.diagnostics`.
* Rename some _testing_ instance members that had the word 'error'
  to instead use 'diagnostic'.

Change-Id: I3948e27ba28ac2494092e04f4e1d201a20cc1135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433004
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-05 14:05:40 -07:00
Sam Rawlins 1804a38ad4 analyzer: Use Diagnostic instead of deprecated AnalysisError in tests
Change-Id: I0fdc8664f1bfd0b887dedd3c7399046ec6ccb3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426901
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-06 08:56:51 -07:00
Konstantin Shcheglov becd91df17 Format analyzer/ with tall mode.
Change-Id: I410cd1cf63fbf00b868bbb3e060433cad3ac9e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423520
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-04-21 12:15:58 -07:00
Konstantin Shcheglov cb96256bc2 Elements. Migrate src/dart/analysis/search.dart
Replace index / search of `CompilationUnitElement` with special
`referencesLibraryFragment(LibraryFragment)`, because they are not
elements.


Change-Id: I4de4ce42270bdad92996bedbd06f108a7c71dffe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412681
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-27 14:13:33 -08:00
Brian Wilkerson 0577ca064d [Migrate] error_reporter_test.dart
Change-Id: Iee6e8ec17881bcc514b8cef9039f88e2f5afcde3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403908
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-10 07:54:39 -08:00
Konstantin Shcheglov 30b3f9d0a6 CQ. Deprecate 'reportErrorForSpan', use 'atSourceSpan' instead.
Change-Id: I4324154842ec462acbdda49e09d1a74f147c56f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383443
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-09-03 20:14:34 +00:00
Konstantin Shcheglov 0ef8f05c6c Fix 'unnecessary_final' in analyzer/.
But don't enable it yet, pending https://github.com/dart-lang/linter/issues/4938

Change-Id: I42df6e5c2699b08d729518c0565165d81e07ad3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-16 21:46:15 +00:00
Konstantin Shcheglov 106db0d7b4 CQ. ErrorReporter, use atElement() instead of reportErrorForElement()
Change-Id: Ife5f6d04ee7c15e7703db3ad81eb7707c7f00ceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352053
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-13 17:16:07 +00:00
Konstantin Shcheglov 2a88162b84 ErrorReporter. Use atNode() instead of reportErrorForNode().
Change-Id: I118fb7623d3effc3bf4bebdeb586196659e8da88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349630
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-02 01:56:59 +00:00
Konstantin Shcheglov 3ea570739d Legacy. Deprecate 'isNonNullableByDefault' in ErrorReporter constructor.
Change-Id: Ia05e113115fb29b47ba12fc9bf46c1d4c04721b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349463
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-01 01:51:48 +00:00
Keerti Parthasarathy c31be01bbe Improve message when generating error ARGUMENT_TYPE_NOT_ASSIGNABLE for records.
Fixes BUG: #53580

Change-Id: I4c5a7b5147875ced2319ba36a396067a5ce1a657
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330668
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-10-18 17:56:49 +00:00
Brian Wilkerson 38581783e6 Generate the list of error codes
Change-Id: I315619a30ac8690e90be2b3a3ad7d849c28f2c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263441
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-10 17:26:00 +00:00
Konstantin Shcheglov 683e2419da Deprecate 'DartType.element2' use 'element' instead.
Change-Id: I6986a058616db489987789cfab09d53a450e3ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262666
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-05 16:30:09 +00:00
Konstantin Shcheglov e03170035a Deprecate 'get name2', use 'get name' instead.
Change-Id: Iee8ef5fb6700d96c857a22a99dc61dac3da88572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-22 02:22:47 +00:00
Konstantin Shcheglov cbfad8f802 Deprecate DartType.element, use specific element accessor for InterfaceType, TypeParameterType.
For `InterfaceType` keep `element2` deprecated and define
`InterfaceElement get element2` instead. Most changes are because
of this.

Change-Id: I13b888610fc707438c3c97b676f1460e7fc2b040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253564
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-04 16:18:06 +00:00
Konstantin Shcheglov 01173e2aa2 Deprecate 'name' in AST, use 'name2' token instead.
Change-Id: I867f009dca12208f835199297d2ea85c203c8556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252566
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-02 16:25:34 +00:00
Danny Tuppeny 147dca35a3 [analyzer] Use LinkedHashSet for recording errors to keep order consistent
Fixes https://github.com/Dart-Code/Dart-Code/issues/3934.

Change-Id: I1cd9fd35ddbbd768877e6b2b2984056ed5ec5d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-20 16:03:18 +00:00
Konstantin Shcheglov 20b560226e Rename newFile2() to newFile().
Change-Id: I1c2a4f15dee607a0a6241dfaf2d764a7d284389b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241510
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 02:59:57 +00:00
Sam Rawlins 843a31fe45 Prefer string interpolations; other small fixes for lints 2.0.0
Change-Id: Ie66c42ac738adbcf07d0b7c5ccc77e34975008c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-18 22:13:21 +00:00
Konstantin Shcheglov 41b3e0abcc Make 'content' required in ResourceProviderMixin.newFile()
Change-Id: Id697b0736b95a913c31247a66425027852f1ddc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 17:31:48 +00:00
Konstantin Shcheglov 60b428e2b1 Deprecate superclass2, mixinTypes2, etc.
Change-Id: Ieaaeab57930cb93f5b6b1323efe63c3395b79993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232742
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-17 02:20:42 +00:00
Paul Berry 0a39aa7cf6 Make all analyzer message arguments non-nullable.
Cases where `null` was being passed as an argument to formatting a
message have all been fixed in previous CLs; all that remains to do is
change the type system to reflect that, and insert `!`s in a few
places.

This brings us one step closer to being able to make analyzer message
formatting type safe.

Change-Id: Id9e0d0b32f29cde0fdc5227417b7a2e3fc3b443d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216272
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-20 11:31:51 +00:00
Konstantin Shcheglov e1b5db7478 Deprecate getters that return TypeName, replace with returning NamedType.
Change-Id: I13764db3da27d5eabe972aab32cdf587a7de53e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 21:01:58 +00:00
Ahmed Ashour f1ded6af56 Remove import dart:core
Fixes #47092

TEST=existing

Change-Id: I3c5c0a1ec5e0426642a5dc70aa9a0391a143ed93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212298
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-06 11:57:40 +00:00
Konstantin Shcheglov 3a2e4d92a2 Remove ExperimentStatus.latestWithNullSafety
Change-Id: I0a813ce1a64f1d6201005280cf7a116deaf8da1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209581
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-08-11 02:37:44 +00:00
Konstantin Shcheglov 79327c9f05 Make ResolvedUnitResult.content/unit non-nullable.
Change-Id: Ia79567d248f2c91290bfdf8204ea7e9f3dc85fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206668
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-14 02:33:10 +00:00
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00
Sam Rawlins 13f9993511 Analyzer: Extract parser test base classes, helpers
Each of the *_Fasta test cases has a lot of test cases from the
corresponding *Mixin mixin. I started to combine _all_ of these
in parser_test.dart, but the file became too long; the formatter
was freezing IntelliJ.

So I've extracted out the non-test classes into parser_test_base.dart.

I'd like to extract each test class into its own file. For now, I
reduce half a dozen *_Fasta/*Mixin pairs into individual test classes.

Change-Id: I8dd7f28a6fe23e31f956cdb2f1d221669db376dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176064
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-12-15 03:57:59 +00:00
Sam Rawlins 1b060fb77b Analyzer: prep for null safety with explicit casts, late hints
* `reference.hasElementFor` implies that `reference.element` is not null.
* Using `whereType` prevents an explicit cast from being needed.

Change-Id: I800f7183292ecd0bb6370a381b1d0b924b7f5a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-06 22:07:43 +00:00
Sam Rawlins e56e5104cf Analyzer: prep file_system tests for null safety.
Fields initialized in `setUp` are late.

Variables initialized with implicit casts like:

    ClassDeclaration clazz = unit.declarations[0];

would need a cast:

    ClassDeclaration clazz = unit.declarations[0] as ClassDeclaration;

so they are updated to use var, which is more idiomatic:

    var clazz = unit.declarations[0] as ClassDeclaration;

Change-Id: I4e4ae814a814d3a4200c5078a6904dbac0a8140c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170520
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 17:39:37 +00:00
Konstantin Shcheglov c2379a800a Move more tests to PubPackageResolutionTest.
R=brianwilkerson@google.com

Change-Id: Ic6c37d069323cc06c6ab630757625a7e0b072200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-06 22:30:39 +00:00
Konstantin Shcheglov ba92b78acd Move errors from StaticWarningCode to CompileTimeErrorCode.
Bug: https://github.com/dart-lang/sdk/issues/42821
Change-Id: I153c48d7a2e4a02026928e6203aacf8f2dc029ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-26 04:19:25 +00:00
Konstantin Shcheglov 1cc5d6927a Deprecate ErrorReporter.reportTypeErrorForNode()
We always want to convert DartType(s) to their String presentations
using getDisplayString(), never using toString(). Also it is OK  to do
some processing during error reporting, it should be rare operation.

R=brianwilkerson@google.com

Change-Id: I57b80cdd7e91de2eb0d06aa84e15ffc0f577090b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-10 18:41:35 +00:00
Konstantin Shcheglov 9456316b51 ErrorReporter should know isNonNullableByDefault.
So, when we call DartType.getDisplayString() we know if the type
presentation should include nullability suffixes.

This fixes many, but not all places where we need to present types.
There are places where we don't go through ErrorReporter, but call
ErrorListener directly. I plan to replace all these with ErrorReporter.

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/39651
Change-Id: Ic77a556e7834d8f757c8b13eed37ed1d34f47348
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-10 01:31:22 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Johnni Winther 00c2962db8 [cfe+analyzer] Move messages, scanner and parser to package:_fe_analyzer_shared
Change-Id: I4fa87aee65f30a9868a6cf8f0342591869ece7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 09:37:57 +00:00
Brian Wilkerson 3f80de6dc5 Generate errors rather than hints for ffi conformance checks
Change-Id: Icb3a3b393200ae7b2cd0d0b603472e90174c970b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121403
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-11 17:18:09 +00:00
Konstantin Shcheglov bf361ebe19 Replace addTestFile()/resolveTestFile() pair with resolveTestCode().
R=brianwilkerson@google.com

Change-Id: Ie3289e355421b0339b012319ce39d2b8eb9569d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-25 16:03:16 +00:00
Konstantin Shcheglov 6a9d792454 Move NullabilitySuffix to API.
R=brianwilkerson@google.com

Change-Id: I58547075d3472e6708e6b5ff1c6d89f768aba66a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 21:14:11 +00:00
Konstantin Shcheglov f470695875 Stop using ClassElement/TypeParameterElement.type in tests.
There are 4 references to `type` left in tests, because it looks
that these tests validate peculiarities of the `type` getter itself.
I will remove them later, when the production code is off `type`.

R=brianwilkerson@google.com

Change-Id: I4b8a590e561fe3d3103500b097c13d989514976e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 15:53:29 +00:00
Brian Wilkerson c2eb9a9860 Add support to the element model for both lazy variables and required parameters
Change-Id: I2733f26cc4ee1be28fc96bbf23402e34449ff030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-12 12:41:48 +00:00
Sigmund Cherem a7175938c3 Remove use of package_root in analyzer/test/error_test
context: the package_root logic is not portable to how we run this test outside
the sdk in other build systems like bazel. To make it work in bazel, we
currently use const.fromEnvironment to override the location of the package
root. Due to upcoming changes to constant evaluation we can't continue using
const.fromEnvironment.

I considered 3 other options:
 * using Platform.environment
 * changing platform_root to be more sophisticated (e.g. look for a folder
 containing `test`, instead of looking for `pkg`)
 * directly defining the root at the beginning of main based on Platform.script

The latter works out of the box in bazel and is also pretty simple, so I felt it
was a good choice.

Note: there are several other tests depending on package_root that we can update
in a similar fashion. Today this is the only test that depends on package_root
that we are running internally in bazel.
Change-Id: Ie7b79a82c78605048b26b9676eac2fbd8b15aaa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98879
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-04-09 16:46:57 +00:00
Brian Wilkerson 0560014c79 Remove unused error codes
Change-Id: I47daa6dab610af657ca781db5ca88438988c3c87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-29 15:37:26 +00:00
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00
Paul Berry 7d277c4a32 Introduce methods and classes to replace "2" variants left over from "UI as code" work.
The AST refactor for "UI as code" left behind a few things whose names
ended in "2".  This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean.  In
a future breaking change release of the analyzer we'll remove the
deprecated things.

The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement

The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2

In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead.  Once all clients have been
migrated we will be able to delete the visitForStatement2 method.

Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-20 22:58:55 +00:00
Brian Wilkerson 122aa43ef6 Convert ListLiteral and remove uses of ListLiteral2
Change-Id: I6c6f60ae969deb798cdbc8572341f2a51256b194
Reviewed-on: https://dart-review.googlesource.com/c/93341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:17:28 +00:00
Konstantin Shcheglov b5eb7d463e Extract and migrate ErrorReporter tests.
R=brianwilkerson@google.com

Change-Id: I5fd12bdd3dc6bacbec61ad9b722a0016cbde2229
Reviewed-on: https://dart-review.googlesource.com/c/92024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-05 19:16:15 +00:00
Paul Berry 70f2969b6c Create a uniform mechanism for finding the 'pkg' directory when running tests.
Several tests need to access source files in the 'pkg' directory, and
they use various mechanisms for finding it.  This CL changes
everything to use the same mechanism.

Change-Id: I146a6d72ec05a20cf07451a83eada9fb8e71a966
Reviewed-on: https://dart-review.googlesource.com/5484
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-13 20:05:40 +00:00