Commit Graph

1972 Commits

Author SHA1 Message Date
Jens Johansen e60cbdfd9e [CFE] Add test for running old dills
This CL:
* adds a test that runs the VM with old dills (compilations of dart2js
  with old checkouts) with the --compile_all argument (1).
* adds a number of old dills (for binary version 25, 27, 28, 29)
  (by mistake binary version 26 sort of didn't really happen)
* adds a PRESUBMIT check in kernel that verifies that we have an
  "old dill" for the current binary version, so one don't bump the
  version without creating a new dill.

(1): It uses --compile_all to force the VM to "read and understand"
     everything in the dill file. The hope being that we try out
     all/most language constructs and thus verifies that they can be
     read by the VM.

Old "old dill" files should be removed once the VM stops supporting that
version. That is a manual process, but a test should complain that the VM
cannot read the old "old dill"(s) once/if that happens.

This should (help) detect errors such as the one recently where a merge
error caused a single "if >= 28" (that should have been "if >= 29" and
thus stopped the VM from reading dills from version 28) to slip through
and require a lot of debugging a few days later.

Change-Id: Id79e16c7ad896c0ccc4e181465b05b67822ac31a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113698
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 12:27:52 +00:00
Johnni Winther ee37965e49 [cfe] Handle static access of static extension members
Change-Id: I9c52ddc7b0c7ef0952471542ee41c231989d80d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113441
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-19 14:47:33 +00:00
Johnni Winther 9c649e67df [cfe] Handle most accesses to extension members from within the extension
Change-Id: I1be167bff0f398793c67834bb80328418e9bb4c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-18 12:25:34 +00:00
Johnni Winther eae781c73e [cfe] Add Field.isLate, VariableDeclaration.isLate and VariableDeclaration.isRequired
Add support for the `late` modifier on fields and local variables in
CFE, and `required` on named parameters When using the option
--enable-experiment=non-nullable the `isLate` and `isRequired` flags will be set
accordingly on Field and VariableDeclaration nodes.

Closes #37686
Closes #37684

Change-Id: If37fc93defdabc5cc974f3f068f57752a665f4cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113036
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-16 19:39:05 +00:00
Johnni Winther 2fda7f8002 [cfe] Handle qualified name as an AmbiguousBuilder.
+ strengthen checkState invariants in the path of the error.

Handles problem brought out by #37776

Change-Id: I55165a1bdaa3a8a0910d71c6d56472bdbfe592c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113183
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-08-16 16:12:58 +00:00
Johnni Winther 9d4e778cde [cfe] Support getters, setters, fields and operators in extensions
Change-Id: Ic84380ea767691bbbb802c65cb72fe43893f78a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112257
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-15 12:12:00 +00:00
Johnni Winther 271ad96813 [cfe] Create Extension nodes for extensions
Adds Extension node to kernel/ast, currently with serialization. This
is needed to support resolution of extension methods through dill
boundaries.

Adds (Source)ExtensionBuilder for build Extension nodes and
DeclarationBuilder as common superclass of ClassBuilder and
ExtensionBuilder.

Change-Id: Id945a40452f2729f9a4f390477dd6c76f9030eaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112256
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-09 20:46:01 +00:00
Vyacheslav Egorov 573789f7f1 [cfe] Insert default super initializer when outlining const constructor
This ensures that it is invoked when performing constant evaluation
in modular setting.

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

Bug: 37794
Change-Id: I26c891044e030ac7702f02b2d4996984f9e898c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112383
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-09 11:26:59 +00:00
Jens Johansen 5601eabda6 [CFE] Spell check messages and dart code
This CL adds a simple spell-checker, adds a spell-checking-phase to
messages_test to spell-check our messages, adds a new test that
spell-check our dart-code and fixes a lot of spelling mistakes / typos.

Change-Id: I8943a5bd67970e9a8a775251ae0aa97799eab097
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112346
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-09 08:47:00 +00:00
Johnni Winther e9a9d9452e [cfe] Build extension methods as toplevel members
+ add an 'isExtensionMethod' property to Procedure.

Change-Id: I8fb1af1802570c827bf3ccbbb9d710eb2a6981ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112081
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-08 12:51:40 +00:00
Aske Simon Christensen 5121a2e831 [cfe] Read product mode directly from environment in async transform.
When we perform constant evaluation in the CFE, the async transform
runs after constant evaluation. Thus, it can no longer use const
bool.fromEnvironment("dart.vm.product") to query whether the VM is
in product mode.

Instead, it can read the product mode define directly from the
environment defines given to the CFE and generate different code
depending on the value.

Change-Id: I2aabc4a84b50a940d35d5664ff4ebdf0680ed5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111645
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-07 08:28:25 +00:00
Johnni Winther 067c6ea5b6 [cfe] Add extension type variables to procedures
Adds synthesized type variable builders and formal parameter builders to
the procedure builder. This ensure that both the outline and body
building correctly resolve extension type variables and extension this types.

Change-Id: I55d5665286dafedb4e47316faafb32ddb6cc33d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111730
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-05 17:15:37 +00:00
Johnni Winther 68e4eeee12 [cfe] Handle property access, update and method invocation on explicit/implicit this in extension methods
Handles property access, update and method invocation on explicit and
implicit this in extension methods. Also use ReadOnlyAccessGenerator
instead of ThisAccessGenerator to handle explicit this.

Change-Id: Ifd6861b1f931f854a39ddfb9ddae35ebf6094327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110904
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-01 12:04:59 +00:00
Dmitry Stefantsov 20e4c74f7f [fasta][nnbd] Print NNBD type modifiers in Kernel's text representation
Change-Id: I48c43858094e2b7264a15be05238bfc3dadd5ecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108264
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-31 08:26:14 +00:00
Johnni Winther 3992be71c7 [cfe] Add this parameter to extension methods
Change-Id: I25326e755d63b5707f8f7ce52b3d80c3965372aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110725
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-07-29 15:58:08 +00:00
Siva Annamalai d9287f4fe6 Reland "[dart] Enable constant-update-2018"
This reverts commit 83d2aaa072.

Reason for revert: Want to reenable const-update-2018 by default.

Original change's description:
> Revert "[dart] Enable constant-update-2018"
> 
> This reverts commit 9bbd3192f4.
> 
> Reason for revert: Reverting enabling of constant-update-2018 by default as some blocking issues were found that are breaking Flutter and preventing rolls of Dart into Flutter. Once the blocking issues are addressed and fixed this CL will be relanded.
> 
> Original change's description:
> > [dart] Enable constant-update-2018
> > 
> > Change-Id: Ib3942b4f6e336a02826305d9f81839333a5464a0
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106943
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> 
> TBR=paulberry@google.com,vegorov@google.com,athom@google.com,vsm@google.com,aadilmaan@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: I5796881412cec464f450ff3894ca253c58edc4a2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109308
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>

TBR=paulberry@google.com,vegorov@google.com,athom@google.com,vsm@google.com,asiva@google.com,aadilmaan@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I06fbeef318706074c0efcfd42b459bf37c3c92e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109661
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-07-25 16:58:49 +00:00
Dan Rubel 3c05b8199b move identifier recovery into scanner
Change-Id: I1e4f4fa900b72e4fd405ae8dc86dfa9bc13f370f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110183
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-24 18:38:43 +00:00
Dan Rubel 34ed30f020 prepend unterminated string error code
Change-Id: I95884700f7a43abfb89753b7381167bac19e4c2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110144
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-24 18:38:43 +00:00
Dan Rubel b41b868797 prepend UnmatchedToken error tokens
This change ensures that instances of UnmatchedToken are always prepended
to the token stream. This should prevent the exception that occurs in
https://github.com/dart-lang/sdk/issues/37491.
This addresses only one type of error token and we may see a similar
exception with other types of error tokens.

Future CLs will prepend other and eventually all error tokens.

Change-Id: I99cdc331c03f47b21c5a67d436a0e62ebf416e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-07-23 15:21:04 +00:00
Siva Annamalai 83d2aaa072 Revert "[dart] Enable constant-update-2018"
This reverts commit 9bbd3192f4.

Reason for revert: Reverting enabling of constant-update-2018 by default as some blocking issues were found that are breaking Flutter and preventing rolls of Dart into Flutter. Once the blocking issues are addressed and fixed this CL will be relanded.

Original change's description:
> [dart] Enable constant-update-2018
> 
> Change-Id: Ib3942b4f6e336a02826305d9f81839333a5464a0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106943
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

TBR=paulberry@google.com,vegorov@google.com,athom@google.com,vsm@google.com,aadilmaan@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I5796881412cec464f450ff3894ca253c58edc4a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109308
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-07-16 22:30:36 +00:00
Johnni Winther db7ab14167 [cfe] Handle invariance in non-covariant checks
To insert covariant checks, CFE was searching for covariance in
contravariant positions and _not_ for non-covariant
(=contravariant+invariant) positions of type parameters. This
let to the omission of needed checks when type parameteres were
used in invariant positions (in function type parameter bounds).

Closes #37476

Change-Id: Icb4a827e75aee1a679ef7175d36904bbfbf6aa0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108815
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-15 07:34:15 +00:00
Vyacheslav Egorov 9bbd3192f4 [dart] Enable constant-update-2018
Change-Id: Ib3942b4f6e336a02826305d9f81839333a5464a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106943
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-07-12 12:32:34 +00:00
Jens Johansen 28f95fcd24 [cfe] Track dependencies in the incremental compiler
The objective of this CL is to allow the incremental compiler to track
which dill input libraries it actually used (in order to - in a modular
context - be able to ignore changes to dependencies we didn't really
use).

This is done by:
* Making the dill library builder lazy (and mark if it has been used).
* Making kernels class hierarchy record which classes it has been
  asked questions about.
* Add special handling to redirecting factory constructors as they
  bypass the fasta-builders and directly use the kernel ast.

Please note that:
* This has to be enabled, but kernels class hierarchy always records
  which classes it was asked about (even if disabled,
  or not running though the incremental compiler).
  There might potentially be some overhead to this (though setting
  a bool to true is probably comparably cheap - we did just do a
  map lookup).
* This was designed to be used together with modules
  (e.g. setModulesToLoadOnNextComputeDelta) - as used via for instance
  api_unstable/bazel_worker.dart. It might not function the way you'd
  expect in other circumstances.
* The incremental compiler (potentially) gives you the full kernel tree
  despite not having marked all of those libraries as 'used'. If a
  client use such libraries it is the clients responsibility to take
  that into account when answering any questions about this
  libraries/dill files was used.
* This feature works on the library level. In practice it is most likely
  needed at the dill-filename level. A translation from library to
  dill-filename is up to the client.
* This is a new feature, and we cannot promise that 100% of actually
  used libraries are marked. If you find used but un-marked libraries
  please report a bug.

Change-Id: I01d7ff95b9baac9550b77d8e09ea772d43173641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-12 10:40:55 +00:00
Johnni Winther f40aac1b75 [cfe] Move general testcases into general/ subfolder
Change-Id: I9bc98033babcf887cca2267606cfe9fadd527b5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108605
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-11 14:10:17 +00:00
Samir Jindel 24725a8559 [cfe] Fix handling of private names in expression evaluation.
Issue: dartbug.com/35505

Change-Id: Ia1d211247852ef116139f8b509c21410fc8629d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108606
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-11 11:40:03 +00:00
Vijay Menon 11da803fe9 [dartdevc] build the ddk sdk with dartdevc
This:
(1) Uses dartdevc and kernel_worker directly to build ddk artifacts.

(2) Generates an outline file instead of a full dill file for ddc_sdk.dill.

(3) Fixes source maps in the shipped sdk so that urls from dart_sdk.js.map
have correct relative paths to dart files in the sdk.  This won't work with
webdev/build as that copies and serves dart_sdk.js, but it will now be
able to build the sdk directly.

Change-Id: I7b9470fe18cac9b4343c7c520fe6ffd7bd9246b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104842
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-11 02:05:37 +00:00
Vyacheslav Egorov c00d5ceb33 [fasta] Include initializers for parameters of instance methods into outline
Fixes https://github.com/dart-lang/sdk/issues/37416

Change-Id: I4a9ebc3a18c2f7afcb77df1c4a19626429caf57b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108603
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-10 21:03:15 +00:00
Vyacheslav Egorov a86db84e0a [fasta] Preserve information about const constructors in outline.
- for classes with const constructors parse field initializers;
- for const constructions parse initializer lists and default parameter
values;

Fixes issue https://github.com/dart-lang/sdk/issues/37357
Fixes issue https://github.com/dart-lang/sdk/issues/36635

Change-Id: Iff0e47f8bd2925cee9f42a2b309de4de84e99cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108279
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-09 14:02:01 +00:00
Lasse R.H. Nielsen aee65636ba Add constructors to Stream which creates single data or error event streams.
Change-Id: I3f570b15d29601a488dc634ab3cc563783868ac2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108102
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-07-08 13:38:54 +00:00
Johnni Winther b8a8cfdcda [cfe] Use InvalidExpression for await on non-async context.
CFE failed to replace an invalid AwaitExpression in a non-async context
with an InvalidExpression. The lead to untransformed (and thus unexpected)
await expressions crashing the hot reload.

Closes #37108

Change-Id: I4457925b20749d231cbf9dac80203ee9b381a312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107501
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-04 08:30:45 +00:00
Dmitry Stefantsov 613b645a44 [cfe] Don't return null when substituting UnknownType
Closes #37381.

Bug: http://dartbug.com/37381
Change-Id: I924bf38c1b16f8dc31c6b574c90f100acf3a6fdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107505
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-06-28 09:03:42 +00:00
Johnni Winther 133a577867 [cfe] Add test for issue 37108
Change-Id: Ib027812341cec8b2ed7b69709432a3940f470848
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107287
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-06-27 08:17:49 +00:00
Dmitry Stefantsov de72f2f1bd [fasta] Fix checks of abstract methods when noSuchMethod is defined
If an abstract method overrides a concrete method, and the abstract one
is more specific, it's an error, unless there's a user-defined
noSuchMethod, effectively making the abstract method concrete.

Change-Id: I06ebe2de257ef6627529e6e97ca11b768c9647b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106084
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov a8f8f1d1a1 [fasta] Fix erroneous dependence of inference on named parameters order
Change-Id: I7013b4c4340a7d6fd543a21f14ac318ff0ecb4d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106080
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov cd709c263a [fasta] Fix an issue with override inference and type parameters
The CL fixes how override-based inference works in the cases when the
type of a parameter in the overriding method is omitted, and the type
of this parameter in the overridden method contains a type parameter
of the class.  Basically, the type should be substituted in this case.

Change-Id: I36d6c614d47e5cd68dc14eae1a2bbe4cd19d842b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104784
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 10a04a4309 [fasta] Fix crash when override inference depends on field inference
Change-Id: I34a273185ba09f2740783cf8a25ac6d5f754c621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104762
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 1aa7f52972 [fasta] Make forwarding stubs operators if their source are operators
Change-Id: I516c0ac9ccf93770cc331b1c7569df1a1c16659c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102160
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 53dde321fd [fasta] Fix override-based type inference for setters
If both the getter and the setter are present in the superclass, the type should
be taken from the setter.

Change-Id: Ie0d84e45d15341151af4a688c508da0f1d7b522d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101988
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov e92bd978ad Fix 'covariant' bit propagation in mixin applications
In the upstream CL https://dart-review.googlesource.com/c/sdk/+/100580 the
'covariant' bit on parameters of class methods isn't propagated correctly in the
case of mixins.  Effectively, if it's used in a member of the superclass of the
mixin application, it won't be propagated to the mixin application or its
subclasses.  Consider the following:

```
class A {
  void foo(covariant num x) {}
}

class B {
  void foo(num x) {}
}

class C {
  void foo(num x) {}
}

class D extends A with B implements C {
  void foo(int x) {}
}
```

The program above doesn't have any errors, and overriding foo in D using int as
the type of the parameter is allowed, because D's superclass A declares the
parameter as 'covariant'.  Without the changes from this CL, the code will
result in a compile-time error.  With the change, the 'covariant' bit is
propagated correctly, and the program compiles.

An existing test already covers the described behavior: see class Mixed in
tests/language_2/covariant_override/tear_off_type_test.dart.

Change-Id: Ia508a224527c95f5ef04c1f1fb02614f8ff43714
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101284
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 5948a2419f Update status files after CL 100580
Change-Id: I01efd49885e4c8cca81e2521cbcd45f1a79ba035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100849
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov bce89db6a5 Reland "Combine override checks and override-based inference in one phase"
Original CL description:

> Combine override checks and override-based inference in one phase
>
> Change-Id: I2760f72f4eaa44bd192747179e843f017db30874
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97301
> Commit-Queue: Peter von der Ahé <ahe@google.com>
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

Change-Id: I8408b35819a89336d10bb11e36c7b1bee707994d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100580
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dan Rubel d63bfe9c33 nullable function type formal param test
Change-Id: Ib2bd27c6c5f8d98a0a07754dce425eab1be9d9c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105000
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
2019-06-24 20:45:03 +00:00
Jens Johansen 153683b1be [cfe] Get rid of 'strong' in incremental compiler tests
Fixes #37302.

Change-Id: Id8e83dfa86dcd188e5541e0465fab08a51e39882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106900
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-06-21 09:53:36 +00:00
Dan Rubel a4b67bd6ce add regression test for issue 37285
Change-Id: Ieb2636ba8404c95a6b3027bd5fccf02876940933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106501
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-20 21:04:37 +00:00
Dan Rubel 683ea6dc67 add fasta extension method test
Change-Id: I8de4f01463aa141ac4104d98b8ba42f970e32021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103881
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-20 20:55:07 +00:00
Jens Johansen e6647f0769 [cfe] Fixes to part with parts
Before this CL we could both crash and add wrong metadata to "part"
nodes when a part defined other parts.
This CL fixes it by
a) Not resetting a counter so *every* part in a part will be out of
   bounds when trying to reference it; and
b) Check if a part directive is in bounds and ignore it if it isn't
   (an error should already have been issued).

Change-Id: I3d31f2577b2120df6461c9cc1002131dbee9dbbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106641
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-19 11:25:05 +00:00
Jens Johansen a878514cf5 Add frontend testcases for part with part(s) in it
Currently there's at least two issues:
* We can crash
* We can add metadata to things they weren't meant for

Change-Id: I4e277ea614ce9faa25b2bf1c5a16a5e877df225b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-06-19 10:56:55 +00:00
Kevin Millikin bd60fa1ad5 [cfe] Write constant field initializers into outlines
For constant field initializers, compile the initializer expression
to Kernel, perform local type inference, and perform necessary
rewrites during outline construction.  This will support constant
evaluation during separate compilation.

Change-Id: I65fe601595c04c45d586d0bac97c2ade6ab15a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104564
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-06-04 13:14:29 +00:00
Kevin Millikin 907f31e6de Reland "[cfe] Build some annotations during outlining"
Reland the change to build some annotations during outlining, with a
bug fix.  Annotations from patch classes and procedures were not
applied to the actual class or procedure, which is fixed.

The original commit was reviewed at
https://dart-review.googlesource.com/c/sdk/+/103806

The revert was reviewed at
https://dart-review.googlesource.com/c/sdk/+/104220

The original commit message was:

    During the outline phase, after top-level type inference, compile
    annotations for libraries, classes, fields, procedures, and
    constructors.

Change-Id: I836160ddad4114ded72701e8a3938f703228931c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104560
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-03 10:20:15 +00:00
Vyacheslav Egorov 39ec9fc4f3 Revert "[cfe] Build some annotations during outlining"
This reverts commit 1df5fb3d57.

Reason for revert: large regressions on Flutter microbenchmarks. Reverting to prevent this reaching Flutter.

Original change's description:
> [cfe] Build some annotations during outlining
> 
> During the outline phase, after top-level type inference, compile
> annotations for libraries, classes, fields, procedures, and
> constructors.
> 
> Change-Id: I95ca65fd58ad88d9452a28d5a0652bee44aeda3a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103806
> Commit-Queue: Kevin Millikin <kmillikin@google.com>
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

TBR=alexmarkov@google.com,dmitryas@google.com,askesc@google.com,kmillikin@google.com

Change-Id: I67c0719f9175c1bd75b609d7d5c0cea5c294bd6d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104220
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-05-30 08:46:55 +00:00