Commit Graph

100 Commits

Author SHA1 Message Date
Brian Wilkerson 1d00a8a11f Add checking for errors related to set literals
Change-Id: Iad1442da6be318a709f5782fbda4a9055f55dfac
Reviewed-on: https://dart-review.googlesource.com/c/84302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-13 20:08:23 +00:00
Brian Wilkerson 22408c6dee Remove references to previewDart2
Change-Id: Id382dd95d3ae90d483467741b5b6d3dbc6c31ea1
Reviewed-on: https://dart-review.googlesource.com/c/83300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 14:52:37 +00:00
Paul Berry 5665636983 Merge commit '7fd78ed5b606e64d30ec201de9adce6fdf8856ba' into analyzer 2018-10-22 13:07:24 -07:00
Brian Wilkerson a342cecffd Disable support for the old super mixins
Change-Id: I8f8074b67ea43249fcc10deddd2325938996d529
Reviewed-on: https://dart-review.googlesource.com/c/79469
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 16:02:01 +00:00
Konstantin Shcheglov c44fa48f8f Extract and rewrite MethodInvocation resolution.
This is a copy of https://dart-review.googlesource.com/c/sdk/+/78182,
but now in the analyzer branch.

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

Change-Id: I75d17a351ee7a33c164d560009cf3ffd088d956a
Reviewed-on: https://dart-review.googlesource.com/c/80942
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 03:36:30 +00:00
Brian Wilkerson 469e1e2e64 Remove unnecessary library directives
Change-Id: I7a157080e4d7fd80d64489a13de4e996b5870930
Reviewed-on: https://dart-review.googlesource.com/c/79474
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 00:44:04 +00:00
Konstantin Shcheglov e221a6288b Move reporting MISMATCHED_GETTER_AND_SETTER_TYPES for classes to using new interfaces.
R=brianwilkerson@google.com

Change-Id: I07e8af54ffebd446a1492fab667e4148468cc2f8
Reviewed-on: https://dart-review.googlesource.com/c/78925
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-10 16:25:49 +00:00
Mike Fairhurst 7f531b5112 Analyzer: Fix missing errors during (a)sync(*) yield of void.
Change-Id: Iff1d87862b2f684c0ce36b0f07620f62f2e49a85
Reviewed-on: https://dart-review.googlesource.com/c/78323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-08 22:27:59 +00:00
Mike Fairhurst 765b8e2d66 More void cleanup
Change-Id: I21e23ab6dec654242d049935e2665389e61dd3d7
Reviewed-on: https://dart-review.googlesource.com/c/78189
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-05 15:34:31 +00:00
Konstantin Shcheglov 9185294e7a Reland: Implement inheritance/override checks from the spec.
Relands https://dart-review.googlesource.com/c/sdk/+/76061
Was reverted in https://dart-review.googlesource.com/c/sdk/+/76301

The difference with the original CL is that we don't look into
superclass and mixins of mixed-in for concrete members. This reduces
the number of errors in Flutter codebase to 1.


R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: I86256b598d116439194cbaf4d09b4f72013d6563
Reviewed-on: https://dart-review.googlesource.com/76340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 18:51:04 +00:00
Zach Anderson 95d37b0921 Revert "Implement inheritance/override checks from the spec."
This reverts commit 836a1d7a88.

Revert "Don't use ClassElementImpl for now in override checking."

This reverts commit 58e44c1400.

Revert "large_class_declaration_test is slow now."

This reverts commit 56f6c52d58.

Revert "Add regression test for issue 34392."

This reverts commit ef7d144bc7.

Revert "Mixin declarations don't have supertype, fix isMoreSpecificThan()."

This reverts commit 95b8a19a20.

Change-Id: Icda9cf9091ef35acc8fd61ac5dc135b3717eba0a
Reviewed-on: https://dart-review.googlesource.com/76301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-24 21:27:34 +00:00
Konstantin Shcheglov 836a1d7a88 Implement inheritance/override checks from the spec.
This CL starts moving checks from strong-mode specific checker,
and old InheritanceManager into an implementation that is based
on the current spec, and avoids old baggage. It also fixes the issue
we were asked to fix for Dart 2.1.

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: Id5a23c5db7704b2b530bb894ae92628a08eaa70f
Reviewed-on: https://dart-review.googlesource.com/76061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 16:28:50 +00:00
Mike Fairhurst 0ec9945885 Fix #33629 boolean negation of void
Bug: 33629
Change-Id: Ieabd07cd7155b60466bf6873ba8252c9b5cb8d70
Reviewed-on: https://dart-review.googlesource.com/75784
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-09-20 23:58:48 +00:00
Konstantin Shcheglov a02a589813 Keep just one UNDEFINED_GETTTER/METHOD/SETTER error.
There is no distinction between them from the langauge of view anymore.

This is a preparatory step before reporting super-invoked abstract
class members as errors, which we should do according to the issue.

Which, in turn, is for consistency between repoting corresponding
error for super-invoked, but not concrete members in mixin applications.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33662
Change-Id: I00e8f185dbbdd1ffac88c500394a1e1497be6f9a
Reviewed-on: https://dart-review.googlesource.com/74481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-11 18:40:02 +00:00
Konstantin Shcheglov 0eee800e1b Report INCONSISTENT_METHOD_INHERITANCE for mixins.
R=brianwilkerson@google.com

Change-Id: I4bfcbccd20049d80deaca346cabf580bdbcaf266
Reviewed-on: https://dart-review.googlesource.com/74320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-10 23:47:44 +00:00
Konstantin Shcheglov e13197d192 Update checks for conflicting class members.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34371
Change-Id: Ic056ff4b2f7c7105d12e9b439fcc0cd268cd5ac1
Reviewed-on: https://dart-review.googlesource.com/73301
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 22:56:06 +00:00
Konstantin Shcheglov 48a1504b2f Stop reporting CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER and CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER.
These errors were removed from the spec.
See also https://github.com/dart-lang/sdk/issues/33235

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34331
Change-Id: Ibc675aa48165300ddac32a8d6ddef4d84d41952a
Reviewed-on: https://dart-review.googlesource.com/72903
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-04 20:29:06 +00:00
Konstantin Shcheglov db8b6bc549 Don't report StaticWarningCode.CONFLICTING_DART_IMPORT.
The warning was removed from the language specification.

Plus some optimization for import scope and conflicts.

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

Change-Id: I78b6924f9095dce89324f4093e78c948611f8493
Reviewed-on: https://dart-review.googlesource.com/72064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-30 20:56:41 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Kevin Millikin 2a36502b02 Squelch some false warnings for disallowed uses of void
The rules for void are changed to allow uses of void where we
previously had a warning, such as the case of assignment to a
variable of type void or passing as a parameter of type void.

Change-Id: I1c1513b0000fa1c8eedbe2645fab503b28024fa3
Reviewed-on: https://dart-review.googlesource.com/70265
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-08-21 09:48:44 +00:00
Mike Fairhurst 222ac2498a Revert "Fix #33415 no error for awaiting a void expression."
This reverts commit 9727a4a4ef.

Reason for revert: Internal breakage; needs to be landed behind a flag.

Original change's description:
> Fix #33415 no error for awaiting a void expression.
>
> Bug:  33415
> Change-Id: I4d4e81fef79a5bc5162e37ab07a8fe99e50c8dfc
> Reviewed-on: https://dart-review.googlesource.com/60522
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=brianwilkerson@google.com,mfairhurst@google.com


Bug: 33415
Change-Id: I66e1bc58bc0966a2348804dbdef6f5901b6aaf55
Reviewed-on: https://dart-review.googlesource.com/67100
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-17 23:48:46 +00:00
Brian Wilkerson 49437e3bae Split TooManyArguments to support quick fixes
Change-Id: I31511f619cafbce01f68d6e182328567a2bc3523
Reviewed-on: https://dart-review.googlesource.com/70021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 13:24:22 +00:00
Brian Wilkerson 87f753dbd3 Replace some declarations of element with declaredElement
Change-Id: Idd62472b16cccaa98749a510197ec8d0f5053cb1
Reviewed-on: https://dart-review.googlesource.com/67820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-02 16:00:36 +00:00
Paul Berry 31af5ce13c Revert CLs reworking generator class handling of non-lvalues.
This arc of work is breaking the Flutter roll--see
https://github.com/dart-lang/sdk/issues/33993.

This reverts the following commits:

- 55c0857037 (Create a common generator class to handle non-lvalues.)

- c9b197017c (Rename "assignment_of" -> "assignment_to".)

- 32fd7b15e4 (Remove special case for assignment to parenthesized
  expressions.)

- 432e59e589 (Fix error reporting if a for-in statement attempts to
  assign to a prefix.)

- 232bed3d11 (Change UnresolvedNameGenerator to use
  NonLvalueGenerator.)

- 0b778d0697 (Change IncompleteErrorGenerator to make use of
  NonLValueGenerator.)

- 1a5f94a0a4 (Fix analyzer-CFE integration of illegal references to
  instance members from static contexts.)

Change-Id: Id637e5ec60150a73031c05d7bb4c6effefd2aa8a
Reviewed-on: https://dart-review.googlesource.com/67091
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-07-27 17:18:28 +00:00
Konstantin Shcheglov 8c4b5be526 Update more expectations for kernel tests.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I9dad5a70e6620a45c5c52653453f1dccb17b17d0
Reviewed-on: https://dart-review.googlesource.com/66415
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-24 23:22:15 +00:00
Mike Fairhurst 9727a4a4ef Fix #33415 no error for awaiting a void expression.
Bug:  33415
Change-Id: I4d4e81fef79a5bc5162e37ab07a8fe99e50c8dfc
Reviewed-on: https://dart-review.googlesource.com/60522
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-24 19:31:57 +00:00
Brian Wilkerson 129dc3c984 Update the failing tests in StaticWarningCodeTest_Kernel
Change-Id: Iee593dfa0207299270e1af13840063336c038292
Reviewed-on: https://dart-review.googlesource.com/66341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-24 13:19:24 +00:00
Brian Wilkerson 14b359fdb9 Map VoidExpression to an analyzer code
Change-Id: I18274a543b486ad874dd95d5dc7a16ecadb801d7
Reviewed-on: https://dart-review.googlesource.com/65563
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-18 16:30:20 +00:00
Brian Wilkerson ab1c1582b1 Remove deprecation hints in analyzer packages
Change-Id: I001e57239a87f2806be74052a5e7686245fea812
Reviewed-on: https://dart-review.googlesource.com/65000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-07-17 15:22:07 +00:00
Konstantin Shcheglov 1c95390082 Store resolution for final fields that initialized multiple times.
Change-Id: Iee57f4540ad2ffeb66498f061f0cca77e53320ab
Reviewed-on: https://dart-review.googlesource.com/64661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-07-12 17:41:28 +00:00
Devon Carew 2dd33c2a6c Have the package:analyzer strong mode option hard coded to on. Delete several spec mode only tests.
Change-Id: I5dffec68d9845fe75936d55100c03306b6eda363
Reviewed-on: https://dart-review.googlesource.com/64060
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-10 05:30:10 +00:00
Paul Berry 45eee81252 Check another case of StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC.
The analyzer was missing cases where the reference to the type
parameter was in an ordinary SimpleIdentifier, not part of a TypeName.

Fixes #21565.

Change-Id: I6be21b296c8c60777238c89a4e5e15a8c0ca8a6e
Reviewed-on: https://dart-review.googlesource.com/63660
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-03 19:58:31 +00:00
Brian Wilkerson 53525542cd Add tests for instance create of an abstract generic class
Change-Id: I040f30ed75e67fca0ef1bb1300d2a77bc27e417c
Reviewed-on: https://dart-review.googlesource.com/63520
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-03 17:42:15 +00:00
Leaf Petersen 8e9e8e1da0 Fix various bugs and regularize behavior of returns statements in
various kinds of functions.

Closes-bug: #31887
Closes-bug: #30638
Closes-bug: #32233
Closes-bug: #32881
Closes-bug: #31278
Change-Id: I4ebd7e71096d611e189b571ba5de2998dd11c98b
Reviewed-on: https://dart-review.googlesource.com/60300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2018-06-15 16:07:44 +00:00
Janice Collins 1afe71c08a Enable preview-dart-2 as default for analyzer.
Based on https://dart-review.googlesource.com/c/sdk/+/52340, but adds
the necessary plumbing through the test system to pass through
negations to strong and preview-dart-2.  Also adds support for those
negations to the analyzer.

Change-Id: I9793ff28bb593d25bbb0a2ed8736b5b53e0a62d8
Reviewed-on: https://dart-review.googlesource.com/52461
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-26 17:01:12 +00:00
Konstantin Shcheglov 6865041334 Issue 27098. Check that argument is assignable to parameter in call().
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/27098
Change-Id: I0d5ac65202b632646bd7b26170c55ab985d2523c
Reviewed-on: https://dart-review.googlesource.com/52263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-20 21:50:59 +00:00
Brian Wilkerson 8819d9fe98 Update analyzer tests for preview-dart-2, part 1
Change-Id: I3440607f7b3892193e1d9883709a1b9d4a7463d9
Reviewed-on: https://dart-review.googlesource.com/46562
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-15 16:45:04 +00:00
Mike Fairhurst 7a0a9284ba Relax void errors: no error assigning void to void variable (+tests)
Change-Id: I1a6e80125dff6f766c9a74b760b557609a2544fb
Reviewed-on: https://dart-review.googlesource.com/40507
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-12 21:24:19 +00:00
Mike Fairhurst 56d59dd967 Reland https://dart-review.googlesource.com/c/sdk/+/37441 with fixes
Change-Id: If8e2ec2ca1ac4f533dcb56b0c95d55e4a13e0598
Reviewed-on: https://dart-review.googlesource.com/39881
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-08 20:46:19 +00:00
Mike Fairhurst ec58f5646a Revert "Make void a static warning to use almost everywhere."
This reverts commit 09eed74a8a.

Reason for revert: Too much SDK code is not yet compliant.

Original change's description:
> Make `void` a static warning to use almost everywhere.
> 
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
> 
> Added a new set of methods to test the cases.
> 
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
> 
> Some redundant tests removed.
> 
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
> 
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-07 22:32:51 +00:00
Mike Fairhurst 09eed74a8a Make void a static warning to use almost everywhere.
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.

Added a new set of methods to test the cases.

Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.

Some redundant tests removed.

Don't flag: ternaries, void -> void assignments, void returns in
dynamic.

Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-07 21:36:01 +00:00
Brian Wilkerson b74ceb0248 Remove a warning (issue 31351)
Change-Id: Id798aa7ece345970e3bfba15b260df6482a57074
Reviewed-on: https://dart-review.googlesource.com/37861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-31 20:42:26 +00:00
Paul Berry 314b89e11d Update the analyzer to require noSuchMethod overrides to be concrete.
See 38dcb10543 for details.

Change-Id: I00608f7106e1b37cde81b8145d8d748f8cd97804
Reviewed-on: https://dart-review.googlesource.com/36520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-24 13:55:18 +00:00
Leaf Petersen 53908b0790 Remove warning for "is" checks with generic type parameters.
The analyzer used to emit a warning when a type parameter to a generic
method was used in an "is" check.  This warning was there to help
users write code that worked correctly on both Dart 1.0 and 2.0.  Now
that 2.0 generic methods are being more broadly supported and used,
this warning is blocking further library work, and is being removed.

Fixes https://github.com/dart-lang/sdk/issues/30530

Bug:
Change-Id: I70395305ad082aee3072b5beeb0b1b7f7883391b
Reviewed-on: https://dart-review.googlesource.com/29821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-15 18:12:03 +00:00
Sam Rawlins ee07335392 Improve message around re-assigning a local final.
Add a new ASSIGNMENT_TO_LOCAL_FINAL code for the new text.

Fixes https://github.com/dart-lang/sdk/issues/28721

Bug: https://github.com/dart-lang/sdk/issues/28721
Change-Id: I5492dd0d9ee09d5b73296b46fe10271661c3c64f
Reviewed-on: https://dart-review.googlesource.com/29621
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 01:09:55 +00:00
Erik Ernst 9336e199fd Re-land of CL 2990703002, adding fixes to analyzer_test and error_test.
This CL is identical to the reverted CL 2990703002 which implements
syntactic support for generalized void in the analyzer, plus two bug
fixes in pkg/analyzer/test/generated/parser_test.dart and
pkg/analyzer_cli/test/error_test.dart. In the former, a test on parsing
`void,` was changed to expect an error: _isTypeIdentifier on a lone
`void` will no longer return true, which is necessary because `void`
can now be used as a type annotation alone. Another test on `void x`
was added, which produces the behavior previously seen for `void,`.
In error_test, the error which is used throughout was changed from
`void foo;` to `var int foo;` (because the former is no longer an
error).

Review-Url: https://codereview.chromium.org/2992623002 .
2017-07-27 12:39:19 +02:00
Erik Ernst 2e73ce1187 Revert "Implemented support for generalized void in analyzer."
This reverts commit 1d44f5296a,
because it causes failures for the analyzer in parser_test, error_test.

Review-Url: https://codereview.chromium.org/2990723002 .
2017-07-26 18:18:04 +02:00
Erik Ernst 1d44f5296a Implemented support for generalized void in analyzer.
Changed the analyzer parser to accept usages of `void` which were
previously rejected as syntax errors: `void` can now be the type
annotation for a variable or parameter, and it can be an actual type
argument.

Removed affected error codes like VOID_PARAMETER, VOID_VARIABLE,
VOID_RETURN_FOR_GETTER and associated declarations (like checking
functions), and adjusted test cases to expect success rather than
compile time errors.

Adjusted generalized_void_syntax_test.dart (it had real errors like
`final` variables with no initializer etc. that were not detected
when tools would just reject the file as syntactically wrong).

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2990703002 .
2017-07-26 17:45:13 +02:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00