Commit Graph

4204 Commits

Author SHA1 Message Date
Dan Rubel 3e69627752 Fix type argument parsing crash
Fix https://github.com/dart-lang/sdk/issues/37706

Change-Id: Ifc54c3fa4f57c772f8059d59e0265c4677a400fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-20 20:04:19 +00:00
Dan Rubel e2777454cc Fix dartfmt bug
... by changing ANNOTATION_WITH_TYPE_ARGUMENTS to be a syntax error

Fix https://github.com/dart-lang/dart_style/issues/836

Change-Id: I2ac1b1105b817b6728ecc3d73875581a9cf65861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-20 20:04:19 +00:00
Johnni Winther 027071318f [cfe] Change outline test to test strong mode
Closes #37904

Change-Id: I75cd093922dbcf29c0b073d6a37aaba9d6c1f5f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113697
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-08-20 13:51:10 +00:00
Jens Johansen 363ae34c55 [CFE] Third batch of fixes for requiring explicit types
Change-Id: Ie4c8e66acf942901602c91819640967e49044233
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113822
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-20 13:11:12 +00:00
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
Dan Rubel f5f942684b Fix invalid literal list element crash
Fix https://github.com/dart-lang/sdk/issues/37697

Change-Id: Icefae7ca0c0f6b0d317c6aa48039fa6e6967409d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113705
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-20 12:03:12 +00:00
Johnni Winther d153e98447 Revert "[cfe] Gather constraints from both possibilities for FutureOr"
This reverts commit 00e9561798.

Original change's description:
> [cfe] Gather constraints from both possibilities for FutureOr
> 
> Closes #37778.
> 
> Bug: http://dartbug.com/37778
> Change-Id: Ic06da9cf4e24e397e1f2a180b743190a4165dc3e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113033
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=dmitryas@google.com,johnniwinther@google.com

Change-Id: I64677971c865180334958de13d2d82fec3daec85
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: http://dartbug.com/37778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113821
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-20 10:57:52 +00:00
Jens Johansen b99df2be86 [CFE] Language versioning - additional tests
Change-Id: I0dd93c3a1d422bbbbbd920fae21569a7bdc91e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 10:08:20 +00:00
Jens Johansen 10e63b7840 [CFE] Get fragment from default package - use language version if any
Language versioning specifies that an empty-name-entry in .packages
specifies a sort of "default package" that a non-package file should
pretend to be a part of "for any purpose where that matters,
including choosing the default language level."

Change-Id: I16f4b2f5e4d3ca1e82d2189321e2be5c43e3b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112089
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 09:06:32 +00:00
Johnni Winther 00e9561798 [cfe] Gather constraints from both possibilities for FutureOr
Closes #37778.

Bug: http://dartbug.com/37778
Change-Id: Ic06da9cf4e24e397e1f2a180b743190a4165dc3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113033
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 08:43:22 +00:00
Dan Rubel bb076a20c5 Fix unsupported initializer exception
... and add a new ParserErrorCode.INVALID_INITIALIZER error code

Fix https://github.com/dart-lang/sdk/issues/37693

Change-Id: I0a30ad97f90aab35cd3af76d1546e1e78f1de2db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-19 19:55:12 +00:00
Dan Rubel 3568f78fe7 ensure super constructor invocation param list not null during recovery
Fix https://github.com/dart-lang/sdk/issues/37735

Change-Id: I727cd7aeb141c5abb779b3c15f338f3d43f6541f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-19 18:34:32 +00:00
Dan Rubel a984c5ce57 improve invalid string literal recovery to fix crash
Fix https://github.com/dart-lang/sdk/issues/37877

Change-Id: If9fe3d42659608bf7cd050de515ec41ca45a697b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-19 17:46:47 +00:00
Dan Rubel bdd77cd0b2 Ensure function type param has non-null identifier
Fix https://github.com/dart-lang/sdk/issues/37733

Change-Id: I552d67aa048eeb5ae4417205f641d71ca7ecadd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-19 17:46:47 +00:00
Paul Berry 0ff0cc1229 Flow analysis: remove unnecessary argument to doStatement_end.
And add unit testing of do statements.

Change-Id: I976780a400cbd852f71d915f1c67b5433ba8807c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113267
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-19 15:49:43 +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
Jens Johansen 0e201edeeb [CFE] Second batch of fixes for requiring explicit types
Change-Id: If4f35550e1df10763b4c13d15eba1d9f53e6095e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113324
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-19 07:19:45 +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
Paul Berry 14e84afb63 Flow analysis: fix incorrect comment
Change-Id: Iec2229fcf1e1688ead0acb094d3397cf4278ab46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113400
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-08-16 20:31:10 +00:00
Mike Fairhurst 0477f8df9e Fix keyword infinite loop
Change-Id: I92bee9991400c229bbf665414a096efae72c14c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113126
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-08-16 20:08:30 +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
Paul Berry 8ab978b6d4 Flow analysis: remove unnecessary parameters from conditional_* methods.
Also rework the flow analysis tests a bit to allow tests to be written
in a more compact way.

Change-Id: I6642ce9987bb89b9b858e709575ce12510c8f442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-16 18:44:00 +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
Aske Simon Christensen 528292bd30 Expire constant-update-2018 flag.
All uses of no-constant-update-2018 in the Dart SDK, Flutter and
Fuchsia have been cleaned out, which means we can expire the flag.

Closes https://github.com/dart-lang/sdk/issues/37874

Change-Id: Ie31dfbf87db52d37fdf4218afa8c6f7a894bafff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113182
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-08-16 13:48:27 +00:00
Jens Johansen a3b579d5c3 [CFE] Add PRESUBMIT.py that runs a little smoke testing
Runs pkg/front_end/tool/smoke_test_quick.dart if changing either
* A .dart file, or
* A messages.yaml file
inside the front_end folder.

Change-Id: I466fda1436806e280e38f90afe77f1c7aa53d021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113321
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-16 12:28:07 +00:00
Jens Johansen 7136d9e4e7 [CFE] Add a 'tool' that runs a quick smoke test
Runs a number of tests that are quick, currently:
* Messages test in a new fast mode which skips compilation
* The spelling tests
* The custom CFE lint test

Change-Id: I7b444e5be1cf2397d6d776aac96dd7c2ad2b302d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113320
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-16 11:14:07 +00:00
Aske Simon Christensen e611357309 [CFE] Error on bitwise or shift operation on a double constant.
Fixes https://github.com/dart-lang/sdk/issues/36823

Change-Id: I9aeb34b9f80261889434f85bf39af3d78a38202e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112391
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-08-16 11:11:27 +00:00
Jens Johansen 050ec9eebd [CFE] Spelling tests give proper error messages
Change-Id: I5a145b070acc4388ecf0ac5dab1a36f5647f6150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113185
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-16 07:24:57 +00:00
Paul Berry fecc4c8f2d Breaking changes for analyzer version 0.38.
Change-Id: I93fbcb9e86c6c809c4610d2d90dc8bc8b69c45c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108162
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-15 19:42:31 +00:00
Paul Berry 23387d636b Flow analysis: merge APIs for handling && and ||.
This will make it easier to integrate flow analysis into the migration
tool, since the migration tool has a shared code path for handling
`&&` and `||`.

Change-Id: Ibf1c7362dfeaab505a2ecf7298b2569a40fca781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113038
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-15 13:34:30 +00:00
Johnni Winther 06ab457ff3 [cfe] Merge Fangorn into Forest
+ rename creation methods of AST node X to createX to simplify usage.

Change-Id: I323c0dba9417f93cd43f409c3f55d17108f53013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112395
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-15 13:14:50 +00:00
Jens Johansen 9552646dc4 [CFE] First batch of fixes for requiring explicit types
Change-Id: Ic27f8508bc95409a5ee8f90b72f34a73d0f8e2e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113034
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-15 13:13:20 +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
Jens Johansen 93d4d28f6c [CFE] Add lint test: Require explicit types
This CL adds a test (lint_test.dart) that gives errors if using e.g.
"var foo = 42;".
We opted to not use the lint "always_specify_types" as that does
more than what the team voted for.

Change-Id: Ia37066ee04ff676d15f41222751557a9245f953f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113032
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-15 10:21:00 +00:00
Jens Johansen cae08c6813 [CFE] Apply lines_longer_than_80_chars lint
Change-Id: I35b62b34d3ccc7098c21a680a80612c0bb927123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113030
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-15 10:01:20 +00:00
Johnni Winther 54f26e3554 [cfe+ddc] Support --target=dartdevc in _fasta/compile.dart
Change-Id: I7288dd3dd03fb58188e3652d9b86e5751c104142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113037
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-15 09:08:40 +00:00
Jens Johansen 3921ae1ee1 [CFE] Enable a number of linters
Change-Id: Ib4c78a6a72ede16c16780496cb779a8afe87ed4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113029
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-15 07:47:04 +00:00
Johnni Winther 024052f367 [cfe+dart2js+analyzer] Remove support for libs in id testing
We now have support for a test as a directory instead.

Change-Id: I3c43e2e57ecda8e3c9d97aa8842be7093c1df5ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113035
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-15 07:31:50 +00:00
Jens Johansen c4727fddf4 [CFE] Apply unawaited_futures lint
Change-Id: I1d783a883c7be84f743724d9eaadc390f84d4b33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113028
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-14 13:42:13 +00:00
Jens Johansen 56c3cfe34c [CFE] Apply prefer_adjacent_string_concatenation lint
Change-Id: I14b3f5060d1eda6a8ea1e0c808593a57f821a725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113026
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-14 13:00:53 +00:00
Jens Johansen 48af666c9f [CFE] apply curly_braces_in_flow_control_structures lint
Change-Id: Id6c7e60b40f7dd0ffd68d007fe86abb785ac0dba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113025
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-14 13:00:44 +00:00
Dmitry Stefantsov 85e26c2ce9 [cfe] Update greatest lower bound ruels for FutureOr
Closes #37439.

Bug: http://dartbug.com/37439
Change-Id: Id4043373e614d8cd4bef6c6d1fc7b7704b3f6ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112722
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-14 10:16:54 +00:00
Paul Berry bb12829571 Prepare to publish analyzer version 0.37.1.
Change-Id: I92f8177c6ca63d510d985adeb9cc338191ffc06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-13 17:20:44 +00:00
Jens Johansen b9217efc77 [CFE] [Language versioning] Issue error on multiple 'dart=' entries
Issue error when the .packages file specifies more than on 'dart=' entry.
Also add another test of the library and part mismatch being an error.

Change-Id: I0a894e6ef86eb9f976b9fbdce67f0c9adb03be9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112881
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-13 10:07:39 +00:00
Jens Johansen e47f354919 Allow ddc in kernel mode to output used inputs
This change basically consists of these steps:
* Enable the incremental compiler to trace used inputs.
* Translate used libraries into used dill inputs.
* Output the list of used dills.

Bug: #37788
Change-Id: Icbc3942226f50ba733196586fac8715e21d6ed34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112385
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-08-13 08:37:29 +00:00
Jens Johansen aeb864a43f Allow bazels kernel_worker to output used inputs
This change basically consists of these steps:
* Enable the incremental compiler to trace used inputs.
* Translate used libraries into used dill inputs.
* Output the list of used dills.

Bug: #37788
Change-Id: I08cffe299166cf10e990c9e261f190afd25da8b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112384
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-08-13 08:28:09 +00:00
Jens Johansen 38336d6b5a [CFE] Split spell dictionary into several different dictionaries
Change-Id: Ie7e274b66d554eb9db8fffdf0e945d78be231ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112392
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-13 07:18:29 +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
Johnni Winther 19654f30d0 [cfe+vm+ddc] Return ClassHierarchy and CoreTypes together with Component
Users of the CFE often need the ClassHierarchy and may CoreTypes after
invoking the CFE. This CL extends the result of `kernelForProgram` and
`kernelForComponent` to a `CompilerResult` that includes these objects.

Change-Id: I08491198fe876b6514e49993ad794388d6662c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112259
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-09 13:02:12 +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