This change fixes pkg/analyzer/tool/summary/generate.dart and
pkg/analyzer/tool/experiments/generate.dart so that the code they
generate corresponds with the changes made in
54b7543c55.
This should fix the broken analyzer-linux-release bot.
Change-Id: I651197da0853687f15bff2f2365f0b85280b5d60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This updates the parser to detect constructors vs methods
in classes vs mixins vs extensions. Rather than generating a single
endMethod event and require listeners to determine the type of
declaration, the parser now generates different events for
different types of declarations so that listeners can process
each of these different types separately.
In addition, this lays the groundwork for fixing extension declaration
error messages and moving error generation that is duplicated
in the various listeners into the parser.
Change-Id: Ia86a4bf3e6f1442ca4926c754b66e7d6e86fb47d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This allows for special-casing extension declarations bodies. This
is needed because the on-clause hold the type of the parameter holding
the `this` value inside an instance method in an extension declaration.
Change-Id: I7af9bf0a9842f7e6f42dddb54fb487c69a8fa519
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111729
Reviewed-by: Dan Rubel <danrubel@google.com>
For const constructors, we need to compile the initializer expressions
and write them into the outline so that we can perform modular
constant evaluation. As a first step, preserve the tokens for the
initializer expressions in const constructor builders when building
the outline.
Currently they are discarded later during outline building at the
point when we should compile them instead.
Change-Id: Ief8d94ceb752b2315982d720836496b7d597e55c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107509
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
AstBinaryWriter does not yet support all node types, but a lot of them,
and can successfully write many large Dart files, including itself.
Whether it does it correctly, we cannot say yet, because AstBinaryReader
supports much smaller set of node types. I plan to add all nodes in
following CLs, and run over larger bodies of code.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: Iaa2a5c743bd1659ea30c93632028d3a475736bf5
Reviewed-on: https://dart-review.googlesource.com/c/94684
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This updates the parser to support a new "!" postfix assert non-null
operator for NNBD experimentation in analyzer. All other CFE listeners
report an error as they always have... albet a slightly different error.
This also updates reportErrorIfNullableType to report experiment-not-enabled
Change-Id: I7751443fd5a7a2756e823f38c78120e9c2e3e075
Reviewed-on: https://dart-review.googlesource.com/c/94580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
We already can store List<double>, but not `double` itself.
The LinkedConstantValue data structure I'm working on will have a
field of type `double`, so I need to support in in the generator.
R=paulberry@google.com
Change-Id: Ic5aa3a9a7266afabe6c64214fd68097fbebda4e8
Reviewed-on: https://dart-review.googlesource.com/c/93820
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The parser now generates a ConstructorWithTypeArguments error and a new
handleInvalidTypeArguments event after a begin/endTypeArguments event pair
when those type arguments are in a syntatically invalid location.
For example: `new C.n<int>();` in
```
class C<T> { T f; C.n() {} }
main() { var x = new C.n<int>(); }
Most listeners handle this event by dropping the invalid type arguments,
but AstBuilder now preserves those invalid type arguments in the AST
to support better code quick-fixes/quick-assists/refactoring.
Change-Id: I5b22bd4903cd9ee3645936b9a108598b603cf9ca
Reviewed-on: https://dart-review.googlesource.com/c/79300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
There are some test failures introduced by this change. I believe
they are due to pre-existing bugs, so I'll address them in a follow-up
CL.
Change-Id: I4e00083e53f92d5c8ac53a7a597b89496402aec4
Reviewed-on: https://dart-review.googlesource.com/74487
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This replaces the begin/endMixinApplication events which were used in both
```
class A = B with M;
```
and
```
class A extends B with M { }
``
with different events for each of the above situations.
This change facilitates properly handling class declarations of the form
```
class A with M { }
```
Removed event:
* beginMixinApplication
* endMixinApplication
Added events:
* handleNamedMixinApplicationWithClause
* handleClassWithClause
* handleClassNoWithClause
Change-Id: Ifa0ecfd7ff8c408087ad78036ad35ba4a00728c6
Reviewed-on: https://dart-review.googlesource.com/73940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Replace most methods with names containing CompileTimeError with corresponding
Problem methods.
Also make Severity.error the default severity.
Change-Id: I4f47bf71dec02347407f2ce4ccfdb04730daf51b
Reviewed-on: https://dart-review.googlesource.com/73221
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This reverts commit f872c17a85.
Reason for revert: After the CQ was green someone else made changes which this CL is not compatible with. The CQ lands if the tests passed
and doesn't rebase before doing so.
Original change's description:
> Remove addCompileTimeError in favor of addProblem
>
> Replace most methods with names containing CompileTimeError with corresponding
> Problem methods.
>
> Also make Severity.error the default severity.
>
> Change-Id: I85a340168848cd3b4375b3f53cb0361251ed6e5d
> Reviewed-on: https://dart-review.googlesource.com/73100
> Commit-Queue: Peter von der Ahé <ahe@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
TBR=ahe@google.com,jensj@google.com
Change-Id: I3ea736a9752805adb3bacc8b67e8eb1435c1bf69
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/73181
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>