Commit Graph

21639 Commits

Author SHA1 Message Date
Peter von der Ahé e1fe4d48a5 Remove type inferrer from generators
The type inferrer is no longer used (and wasn't necessary to begin
with, it should have been exposed via the helper object instead).

Also some other tweaks that should help me avoid merge conflicts.

Change-Id: I1f2aade93f9c836cc02dac6c002f48156caf2c76
Reviewed-on: https://dart-review.googlesource.com/74063
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-10 09:05:59 +00:00
Peter von der Ahé c42bde5eac Remove type-inference listener
Change-Id: I00db170300a55ff9adc51c36f851ce3454d1e34a
Reviewed-on: https://dart-review.googlesource.com/73882
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-10 08:43:24 +00:00
Johnni Winther f3036f4e17 Support supermixins in dart2js
The tests use the old syntax which CFE currently (wrongfully) allows for dart2js.

Change-Id: Ia4dde9e6e1444d8ec22905c36209049bd4161faa
Reviewed-on: https://dart-review.googlesource.com/72443
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-09-10 08:16:57 +00:00
Johnni Winther 5e263044e8 Enable StrongModeWorldStrategy
This makes closed world computation take the static type of the receiver
into account and removes non-live members from the J-world.

Change-Id: I5547aaae4685c6417a94916df0bc4e621296ce8d
Reviewed-on: https://dart-review.googlesource.com/72643
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-09-10 07:09:07 +00:00
Konstantin Shcheglov 9e3bcc4cec Report MIXIN_INSTANTIATE when a mixin is instantiated.
R=brianwilkerson@google.com

Change-Id: Ia19d69bd7f0212bcdfb37f228046c727a36d62e3
Reviewed-on: https://dart-review.googlesource.com/74042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-09 17:04:48 +00:00
Paul Berry c925fa6b00 Lay the groundwork for comparing language_2 compilation results between analyzer and CFE.
This CL just adds the compiler=compareAnalyzerCfe option to the test
framework, and updates the status files so that no language_2 failures
are expected when this "compiler" is used.  A placeholder executable
has been added to sdk/bin, but it is not wired up yet--that will be
done in a future CL.

In a future CL I will wire up the placeholder executable to the code
in pkg/analyzer_fe_comparison, and fill in the methods in
CompareAnalyzerCfeCommandOutput to process the output accordingly.

Change-Id: I27439de4ac609cb8b003f157a0ff88d181bfbcae
Reviewed-on: https://dart-review.googlesource.com/73561
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-09-08 15:25:05 +00:00
Paul Berry 9795cd9613 Remove uses of DartType from const expression serialization.
These types were used long ago when we sometimes generated summaries
from an element model; they haven't been used in a long time.

Change-Id: I73d5e52cc3c35ce1d5ebb68bae59c8a795ce279f
Reviewed-on: https://dart-review.googlesource.com/74013
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-08 00:02:59 +00:00
Paul Berry 13efc4f8d8 Convert test_strategies.dart to triple-slash comment style.
Change-Id: Ia6c1756d147040fec07aaed1f547b6b2c4a495b2
Reviewed-on: https://dart-review.googlesource.com/74011
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-07 23:14:11 +00:00
Johnni Winther 134bb884de Handle generic types in native behavior
Previous implementation didn't include subtypes of the specified type.
For instance `JS('Rectangle', ...)` should have triggered the inclusion
of `_DomRect` but the use of this-type in the subtype test,
`_DomRect <: Rectangle<T>`, prohibited this.

This fix is to use the raw type instead of the this-type. The subtype test
will therefore be `_DomRect <: Rectangle<dynamic>` which correctly
includes `_DomRect`.

The change has the effect that `JS('List', ...)` now actually includes subtypes of
`List`. For this reason uses of `List` have been updated to use `JSArray` or
explicitly use `returns:...` to avoid unintended inclusion of native lists such
as the native typed arrays.

Change-Id: I06ab55d9bf694829596875d9c3a0a6c954d396b7
Reviewed-on: https://dart-review.googlesource.com/73903
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-09-07 22:28:37 +00:00
Jenny Messerly be5cd6307f fix #34296, generic function instantiation should be checked eagerly
Change-Id: I8c6e0980c23d8ca2cb22db9411028b59be5eb8db
Reviewed-on: https://dart-review.googlesource.com/72545
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-09-07 21:34:36 +00:00
Konstantin Shcheglov c29ec5994c Resolve super invocations in mixin declarations.
R=brianwilkerson@google.com

Change-Id: I81dddc8187a13a17db91f77dc0df19248db7d45b
Reviewed-on: https://dart-review.googlesource.com/74007
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 20:06:21 +00:00
danrubel a9cc6f0f19 Revise with clause event handling
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>
2018-09-07 19:33:51 +00:00
Alexander Markov 9c8e9f02a3 [vm/kernel] Support CheckLibraryIsLoaded node in kernel constant evaluator
Change-Id: I5530c54ce86a61e1545c727215ca561c77b86e99
Reviewed-on: https://dart-review.googlesource.com/73840
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-09-07 19:32:11 +00:00
Konstantin Shcheglov 1e65a6fa7f Check for conflicts of constructors and static members.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34371
Change-Id: I55494cbb770dbdc1418cac9c74672ebbab7ab24d
Reviewed-on: https://dart-review.googlesource.com/74004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 18:33:15 +00:00
Brian Wilkerson 2aca0b8b67 Fix a test broken on Windows
Change-Id: I2612573bee93ec04e769cd627a4f4f0031937883
Reviewed-on: https://dart-review.googlesource.com/73980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-07 18:22:22 +00:00
Brian Wilkerson fe5a99dd75 Add hover support for mixin declarations
Change-Id: Ia42f39aec7b001264ae69043fe76ceb2c79b76cb
Reviewed-on: https://dart-review.googlesource.com/73960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-07 17:52:45 +00:00
Jens Johansen 1e4b3e9754 Train kernel-service on Windows
Now, on Windows:
hello.dart (hello world script): ~0.33s, ~0.33s, ~0.29s, ~0.28s, ~0.29s
pkg\complier\bin\dart2js.dart --help: ~3.37s, ~3.36s, ~3.40s, ~3.50s, ~3.41s

Before, on Windows:
hello.dart (hello world script): ~0.85s, ~0.87s, ~0.86s, ~0.90s, ~0.91s
pkg\complier\bin\dart2js.dart --help: ~6.12s, ~6.20s, ~6.26s, ~6.13s, ~6.04s

So...:
hello.dart (hello world script): -65.3759% +/- 4.15274% at 95.0% confidence
pkg\complier\bin\dart2js.dart --help: -44.5854% +/- 1.68273% at 95.0% confidence

Change-Id: I6679a7fff68c146390ef70832278ece6eb120c7c
Reviewed-on: https://dart-review.googlesource.com/73921
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-07 14:31:03 +00:00
Konstantin Shcheglov cbab413950 Collect super-invoked names for mixin declarations.
We need this to support the following requirement in the mixin
specification:

It's a compile-time error to apply a mixin containing super-invocations
to a class that doesn't have a concrete implementation of the
super-invoked members.

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

Change-Id: Ib683794fe7101222863b34956619773e2af52d1a
Reviewed-on: https://dart-review.googlesource.com/73780
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 14:25:45 +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
Peter von der Ahé e0b6a2edb7 Don't create growable lists for non-Kernel objects
Change-Id: Iaf44a0073f6641e0f8f47e252818fcbfa010140b
Reviewed-on: https://dart-review.googlesource.com/73481
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-07 07:12:17 +00:00
Peter von der Ahé 196687f0ef Refactor handling of formals
Change-Id: I5e4279d5f0668d5d770be93cc14fc866862761cd
Reviewed-on: https://dart-review.googlesource.com/73460
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-07 07:12:17 +00:00
Peter von der Ahé 51dc3aa370 Improve handling of catch parameters
Change-Id: I216b352e6c140a364930d4005f8d9f9d3809d257
Reviewed-on: https://dart-review.googlesource.com/73420
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-07 07:12:17 +00:00
Lasse Reichstein Holst Nielsen f0172a4c41 Export Future and Stream from dart:core.
This allows `async` and `async*` functions to be typed without importing `dart:async`.
All other async types still need to be imported, including `FutureOr` and `Zone`,
but pure `async`/`await` based code can be written with no imports.

Fixes #26162.

Bug: http://dartbug.com/26162
Change-Id: Iaf36631ef5b3251a688e495a9d238b2f8787f14c
Reviewed-on: https://dart-review.googlesource.com/71480
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-09-07 06:14:32 +00:00
danrubel d761e97178 Remove WithWithoutExtends error code
Change-Id: I1bfe3721200493945580fa1e687ff565a7a79cf0
Reviewed-on: https://dart-review.googlesource.com/73820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-07 04:15:28 +00:00
Paul Berry 2fb058e873 Skip non-const expressions when performing one-phase summarization.
The only reason to include non-const expressions in an unlinked
summary is for type inference, but for one-phase summarization, we're
going to perform type inference directly based on the source AST.  So
skip non-const expressions when doing one-phase summarization.

This requires modifying several summary tests so that they no longer
expect the non-const expressions to be present in the unlinked
summary.  It also causes a few tests of one-phase summarization to
start failing, since the AST-based type inference logic hasn't been
implemented yet.  This is ok because one-phase summarization isn't
exposed to customers yet; it will be fixed in follow-up CLs.

Change-Id: I7455fd82b64c59362439206a05a9eb3691c8e397
Reviewed-on: https://dart-review.googlesource.com/73688
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-07 00:54:54 +00:00
Dan Rubel 7905136e64 Allow with clause without extends clause
This removes the code the generates an error when a `with` clause
is used without an `extends` clause as in
```
   class C with M { }
```
This is the first of several CLs to update the parser
as this CL only prevents the error from being generated.

Change-Id: I1d5c8577902e253a4c83cda2f6a1d4ab98319903
Reviewed-on: https://dart-review.googlesource.com/73687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-07 00:25:58 +00:00
Brian Wilkerson 8255ac0b76 Do not show mixins in the extends clause
Change-Id: I1e1d757958cb12fc25e2805524cf3fb325634973
Reviewed-on: https://dart-review.googlesource.com/73690
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-07 00:03:48 +00:00
Brian Wilkerson fdcbe5dc93 Rename test files to be recognized by test.py
Change-Id: Id302623c9ff257647981f713c7229120bd70ada8
Reviewed-on: https://dart-review.googlesource.com/73800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 23:31:32 +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
Kevin Millikin 3224afe9fe Fix a bug in valid return detection
We had implemented the rule for invalid returns in asynchronous
non-generator functions with return type T and a return expression
with static type S:

  is an error if flatten(T) is void and flatten(S) is not void,
  dynamic, or Null

and the actual rule should be:

  is an error if T is void and flatten(S) is not void, dynamic, or
  Null

which requires T to be exactly void and so signals fewer errors.

Change-Id: I296bb8a607d6e5ad862017674091eafe0f6016da
Reviewed-on: https://dart-review.googlesource.com/73740
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-09-06 21:50:43 +00:00
Konstantin Shcheglov ffc716addf Check that mixin superclass constraints are satisfied.
R=brianwilkerson@google.com

Change-Id: If0957b0868da7c7330bd561b6e91dfb0379fa226
Reviewed-on: https://dart-review.googlesource.com/73720
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 21:17:51 +00:00
Paul Berry 6ce37c6541 Convert summarize_ast.dart to triple-slash comment style.
I anticipate heavily modifying this file, and I don't want to have to
mix comment styles when I do so.

Change-Id: Ib93bf5489f080456da81f03f82bd7e850498748c
Reviewed-on: https://dart-review.googlesource.com/73683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 21:09:40 +00:00
Brian Wilkerson 39535676c8 Add completion support inside the on clause
Change-Id: I55a118a6e2d684ad917b2371d640c658119e3559
Reviewed-on: https://dart-review.googlesource.com/73700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 20:02:48 +00:00
Konstantin Shcheglov 230ff965da Report a compile-time error when type arguments after the constructor name with implicit new.
Bug: https://github.com/dart-lang/sdk/issues/34270
Change-Id: I38e919847f25d204c26ec74d04fa49cc46063434
Reviewed-on: https://dart-review.googlesource.com/73600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 19:54:50 +00:00
Paul Berry a5d9eb01c2 Convert link.dart to triple-slash comment style.
I'm going to be adding a lot of new functionality to this file, and I
don't want to have to mix comment styles when I do so.

Change-Id: I35fb7b93b2cfc200995364028ea10bab9c8f1245
Reviewed-on: https://dart-review.googlesource.com/73640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 19:52:26 +00:00
Brian Wilkerson e20064b8bf Add syntax highlighting support for the new mixin syntax
Change-Id: I4d6cfdfe0cd8d9c5be82c6efabeb642c4ca87e72
Reviewed-on: https://dart-review.googlesource.com/70902
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-06 19:49:20 +00:00
Konstantin Shcheglov 8d9320f777 Test for mixin named 'on'.
Remove explicit _checkForImplementsDeferredClass(), some other mixin checks.

R=brianwilkerson@google.com

Change-Id: I134200d1e78315c19218cf7a9ff4efba7fc50fb8
Reviewed-on: https://dart-review.googlesource.com/73660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-06 19:47:12 +00:00
Paul Berry 66863ea6e2 Avoid a "missing_return" warning in flattenName.
The analyzer can't tell that `unhandled` is guaranteed not to return,
so it thinks that `flattenName` might exit without returning a value.
An easy workaround is to return the result of calling `unhandled`.

This is needed to roll kernel into the internal Google codebase, in
which the "missing_return" warning causes build failures.

Change-Id: I38133db0c2058d687c2f408cc8c8dbf224551408
Reviewed-on: https://dart-review.googlesource.com/73560
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 17:52:20 +00:00
Alexander Markov cdd18e6811 [vm/bytecode] Support dynamic invocation forwarders and omit checks in bytecode
This CL adds support for _dynamic_ calls (which are routed through
dynamic invocation forwarders) to bytecode pipeline.

This allows to skip argument type checks for non-covariant and
non-generic-convarint-impl parameters in bytecode when calling instance
members through known interface targets. In case of dynamic call, dynamic
invocation forwarders perform type checks which are otherwise skipped.

This CL also corrects argument type checks in forwarding stubs.
Forwarding stubs are synthetic methods, introduced by front-end to ensure
type safety if some of the argument type checks are skipped.
The specifics of forwarding stubs is that they should use parameter types
of a *target* of a stub for the argument type checks.

This change unifies how argument type checks are performed in bytecode
and in the VM in JIT mode. This allows to mix bytecode methods with
methods JIT-compiled from kernel AST in more cases.

Change-Id: I3a2720a488c8bbb91de1b189eb36ee8c51684a78
Reviewed-on: https://dart-review.googlesource.com/72543
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-06 17:23:12 +00:00
Paul Berry e72fd5294a Deprecate unneeded fields from PackageBundle.
Change-Id: I071a44499ef20a32388eea7ba04264c8c9b8e1c9
Reviewed-on: https://dart-review.googlesource.com/73285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 14:16:10 +00:00
Peter von der Ahé d6cd15b80b Restore types to aid refactoring
Change-Id: Ib58e4cad0727f3b0556f21395bd0dddff3fc66de
Reviewed-on: https://dart-review.googlesource.com/73380
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-06 10:25:15 +00:00
Peter von der Ahé b62eef3d8b Use LocatedMessage for invalid types
Change-Id: Ib233b40211d1893b1de6bea36e84c91c81a49fa9
Reviewed-on: https://dart-review.googlesource.com/73343
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-06 10:25:15 +00:00
Peter von der Ahé 2782266d5c Unify QualifiedName and Identifier
Change-Id: Ie7e7131c58186efd5ed4e81e2f010cc240ce8d03
Reviewed-on: https://dart-review.googlesource.com/73341
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-06 08:57:07 +00:00
Peter von der Ahé 04d3e448dd Clean up KernelFormalParameterBuilder
Change-Id: Id0fce5cc75996fd5f88e22a5182b2dc1061d2beb
Reviewed-on: https://dart-review.googlesource.com/73320
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-06 07:27:50 +00:00
Johnni Winther c715e8125d Refactor global inference data to prepare for serialization
Change-Id: If88b948ca80b1a7915d87a49ba4e1d05de669282
Reviewed-on: https://dart-review.googlesource.com/72401
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-09-06 07:11:44 +00:00
Johnni Winther f9bb407eba Delete analyze_dart_test
- this tested Dart 1 semantics of the dart2js implementation

Change-Id: Ib80b3a056f552e9826b5c97a88dab9df3e15570e
Reviewed-on: https://dart-review.googlesource.com/72821
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-09-06 07:10:04 +00:00
Peter von der Ahé d1e2ee28f3 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: 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>
2018-09-06 06:56:42 +00:00
Paul Berry a2f4ab5b52 Add an API for generating analyzer summaries in one step.
Currently, analyzer summaries are generated in a two-step process,
translating compilation units into unlinked summaries and then linking
the unlinked summaries together to form linked summaries.  In order to
support full unrestricted type inference, we'll need to build
summaries in one step, so that the full AST of initializers is
available for inference during linking.

This CL introduces a new API for one-step summarizing, along with test
cases to exercise it.  For now, the one-step summary logic just
invokes the old two-step summary process.  In future CLs I'll rework
it to be a true one-step summarizer so that the type inference
restrictions can be lifted.

Change-Id: Ic8d55850972f4697b5c6cc6fabe5d26dc7c1288c
Reviewed-on: https://dart-review.googlesource.com/73300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 04:18:46 +00:00
danrubel dc0aae5c44 Improve super initializer recovery
This CL addresses one of the issues in https://github.com/dart-lang/sdk/issues/34041
by fixing an AstBuilder crash and improving recovery of super constructor calls
in a constructor initializer list.

In addition, this adds a TestDescriptor adjustValidUnitBeforeComparison field
to support the new recovery tests.

Change-Id: I9e687aed34ea293700bd45d7c13ce36e83a00a05
Reviewed-on: https://dart-review.googlesource.com/73286
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-06 01:16:55 +00:00
Konstantin Shcheglov 169949985a Move CONST_WITH_TYPE_PARAMETERS reporting to ConstantVerifier.
Linter also should be updated to check for this error in HasConstantErrorListener.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33612
Change-Id: If4a2535ffe04d965bbd46b5c92679e6132bf500e
Reviewed-on: https://dart-review.googlesource.com/73283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-05 20:51:10 +00:00