Commit graph

25455 commits

Author SHA1 Message Date
Paul Berry e5f069b5dd Migration: add missing type annotation
Change-Id: Ie219297a4ffe203e0b15157471a2a59f1b1029a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105960
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 15:21:50 +00:00
danrubel d6f5a245b2 parser error token cleanup
This removes one location where ErrorToken processing is no longer needed
in the parser, and updates the analyzer parser tests to use scanString
rather than instantiating the scanner directly.

Change-Id: I399d771004af7f9fe25d19c1065fbfd425416edc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-13 14:30:10 +00:00
danrubel 8adde6b603 make extension declaration name optional
This CL updates the parser to parse extension declarations where
the extension name is omitted. For more details, see
https://github.com/dart-lang/language/pull/303/files#diff-9b84d2e3c88265bde2eb43544ddb757dR66

This change explicitly does not handle the case `extension on on on { … }`.
A subsequent CL should either make `on` a builtin
or add more lookahead in the parser to allow this edge case.

Change-Id: Ided821192770f88a51a3300fed8cb0fdef9eea3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-13 14:29:40 +00:00
Johnni Winther f889bd7067 Delete JavaScriptBackend
* move names to Identifiers
* move resolution parts to front end strategy
* move codegen parts to backend strategy
* remove now unneeded methods from FrontendStrategy and BackendStrategy

Change-Id: I0675d56045dd212ad195177ecd23b27b0d849a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-13 10:09:46 +00:00
Aske Simon Christensen 50efd7f187 [Kernel] Add list of unused arguments to InstanceCreation nodes.
During constant evaluation, unused arguments to a const constructor are
thrown away after evaluation, since their values do not affect the
resulting instance constant. If such an unused argument ends up
unevaluated, any errors that would arise in the final evaluation are
not reported.

This CL adds space in the Kernel AST for saving these unevaluated
expressions so they can be checked during final constant evaluation.

Even though this is an incompatible change, no update is needed to the
VM code (except for the version bump), since the VM does not support
InstanceCreation nodes in the first place.

Change-Id: I4752562c1164efbba79eb018c15b07ed8354ce5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-06-13 09:42:26 +00:00
Danny Tuppeny 06b28fc60f Filter TODOs out of LSP diagnostics
Change-Id: I4a089be3919e0a2ed6c1e54e712ba7f1c9d835aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-13 07:31:36 +00:00
Mike Fairhurst 23d3e8a25f Land new subtyping algorithm; more tests but still not comprehensive.
Includes changes to implicit covariance test.

To redescribe this, for some tear-off C<T>.f, the member type may be
contravariant if T is referenced by a parameter of C<T>.f (such as if it
is of type void Function(T)). This must be a runtime failure if C<T> is
a reference which has been covariantly upcast at runtime. For example,
List<Object>.add, where the list is at runtime an instance of List<int>,
results in a static type of void Function(Object), but a runtime type of
void Function(int), which is unsound.

We omit these checks, however, when it is trivially sound for all cases
Previously, this was the case for tearing off `List<Null>.add`. This is
no longer a valid test case for NNBD where the runtime type of that list
could actually be `List<Never>`.

Therefore the test has been changed to expect `List<Null>.add` to result
in a cast, and a new NNBD test case has been added to test `List<Never>`
cases don't get a cast.

Change-Id: I61d024a249e2c2a249ad5a8037cbe3d103e3ea8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104361
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-12 23:48:48 +00:00
Brian Wilkerson 52ae429a9e Add some minimal support for instance creation expressions
Change-Id: I7184b8b5955d61e0d1452a8ff071aaab8ceb5dce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105728
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-12 23:47:39 +00:00
Nicholas Shahan aaf7d2023f [dartdevc] Fix violations of unawaited_futures lint
Issue: #37218
Change-Id: I736afd1a339be0573126ed2184b9a04e0ab73f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-12 23:27:17 +00:00
Paul Berry eec587e97d Migration: address a more complex case of instantiate-to-bounds.
Change-Id: I8a7d5e2e4189c3d910077ad4ec88e6c4e384dc25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105731
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 23:03:57 +00:00
Paul Berry f2cc27ffbf Migration: preliminary support for interface types without type parameters.
I'll build on this in future CLs to address more complex cases, where
the type is instantiated to a bound.

Fixes #37213.

Change-Id: I1e23c5599557ef17177483222f15b1a7985b9ca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105726
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 23:03:57 +00:00
Mike Fairhurst 2f65830aeb Add null checks for spread operator
Change-Id: Ib3b0f46643a24e22e0344a4505743518f885e9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-12 20:58:03 +00:00
Paul Berry 3f83aeb493 Migration: add the ability to "union" nullability nodes.
This will simplify some situations where nullability migration would
otherwise have to visit the source code in a very careful order.  For
example, when analyzing top level fields undergoing type inference, we
can simply create a node for the nullability of each top level field,
and then later use the "union" operation to hook up those nodes to the
nodes resulting from analyzing their initializers.  Without the union
operation, we would have to be careful to visit the top level fields
in dependency order.

Change-Id: I3b07e1abccc5b1c9f1c7c9fa7b13fb6af60c07d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 20:10:24 +00:00
Paul Berry 0b5e37a429 Migration: Make always/never instance fields of the nullability graph.
Previously, they were static, which made them easier to access, but
made it difficult to track their edges (because we couldn't safely
mutate them, so we had to store their edges in special fields of
NullabilityGraph).  Now that we're passing NullabilityGraph all over
the place anyhow, there's no benefit to making them static anymore.

Change-Id: Ia3e7d32ae479f40f505621e5d6df04060e39b1c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105723
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-12 20:10:24 +00:00
Paul Berry 69d88daeb9 Remove unused imports
Change-Id: I08ae4f32ea9eb08f1147db2d056917fe4833e5e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105780
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 17:54:24 +00:00
Konstantin Shcheglov 4324d46080 Use an available socket port for memory benchmark.
R=devoncarew@google.com

Change-Id: I96472010b6bfa01e0ae2254f105d8e71bb7e86d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105683
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-12 16:18:14 +00:00
Konstantin Shcheglov 0e4e14a288 Build summary2 in DDC.
New summary2 will unblock fixing long standing inference issues in
Analyzer.

We build it in addition to summary1, and will switch clients to summary2
incrementally. With this CL DDC will build summary2, but will not
consume it yet for analyzing code. This will be done in a separate CL.

This change was also tested in the internal repo, and does not cause
related build failures.

Change-Id: Ic2c635e45b514a2610e938129fa7527fd8d070b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105261
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 16:09:24 +00:00
Konstantin Shcheglov a173d22fe7 Record reference to the typedef from which a FunctionType was instantiated.
It seems that this is necessary for Angular compiler.

R=brianwilkerson@google.com

Change-Id: Ib5c0501d8f900ec9ca358cb4f4b4be90004cce77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-12 14:22:03 +00:00
Paul Berry b385528fee Migration: Write unit tests for NullabilityGraph.
Change-Id: I7d3ab1bde98ff28203dc73d61ecdc77e8fed25f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 13:34:57 +00:00
Paul Berry c286d5a549 Separate testing methods from the rest of NullabilityGraph
So that we don't accidentally start to use them elsewhere in the
migration engine.

Change-Id: Iee290f9fc8761c952a2aadb1f4f6bb7bfe061a3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 13:34:57 +00:00
Danny Tuppeny c177b4cc4c Make the ranges of constructors in hovers match those of methods/functions
Fixes https://github.com/dart-lang/sdk/issues/35386.

Change-Id: I66c0b1b9f47b8f037da9585453330d6eb1de3c4e
Bug: https://github.com/dart-lang/sdk/issues/35386
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-12 13:28:37 +00:00
Danny Tuppeny cbb1816177 Remove unnecessary LSP hover handling comment/code
Change-Id: I1609dd07dae57b6bac48492c64f7ac1a7fb82d5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105741
Auto-Submit: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 13:25:27 +00:00
Paul Berry 686df33d99 Add parseString() to replace the deprecated parseCompilationUnit().
Change-Id: Ib272f6a281b09a02ba037049e76bf08dd78dbbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105540
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 12:56:57 +00:00
Terry Lucas 92dabc8491 Cache the WidgetCreatorTracker.
This fixes the problem when the flutter bots run multiple tests from the flutter tool e.g.,
  flutter test first_widget_test.dart second_widget_test.dart

The first test causes the set of libraries, particularly Flutter's framework library, to be passed
to the transformer. The transformer needs the 'Widget' class located in Flutter's framework
library. The transformer on the first test works.  Each subsequent test only the libraries not in
the prior test are passed, without the framework library, the transformer is unable to find the
'Widget' class and the widget transformer fails to run.

This fix allows the use of a nice speedup to hot-reloading Flutter applications when
--track-widget-creation is enabled and it allows us to enable --track-widget-creation by default,
for command line Flutter users.

This fixes issue https://github.com/dart-lang/sdk/issues/36640

R=jacobr@google.com,askesc@google.com

Change-Id: I9a9c9dc69995122d0f7a7a3e1dfaebf57abb4afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105661
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-06-12 11:07:36 +00:00
Johnni Winther cbe48553c0 [CFE] Add LocalFunction as super-interface for FunctionExpression and FunctionDeclaration
+ use it in dart2js to simplify and clarify handle of local function nodes

Change-Id: I35da2dd8bd3baba6eff6ad631ebe63d572bae4d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105423
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-12 07:20:39 +00:00
Sigmund Cherem 080ff1f3b9 Fix parsing of output-directory Uri in windows
Change-Id: I3e3417e5048f8545056d99df35ca2de140dc31f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105680
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-11 23:21:43 +00:00
Mike Fairhurst dab4eb045f Add a "legacy type asserter," manage broken test cases
Change-Id: Ic046805c3246ad7e5e7c56fb9188d6ebd197e2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105560
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 23:17:43 +00:00
danrubel f69d5dc2c2 show analyzer details in dartfix
This updates dartfix to display details about the analysis process
if the analysis server provides them.

Change-Id: I0b2a7e8267b92e1eefd1ce90aa53a85cc91c48d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105549
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 22:46:13 +00:00
danrubel a3348ab702 sort some dartfix classes
Change-Id: I0655c6ae7d06219ee17957c9c49e90fbf8afe63d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105548
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 22:46:13 +00:00
Sigmund Cherem 7c7160f022 Move isRedirectingFactory to CFE and add unit test for it.
Eventually it should be handled by Procedure.isRedirectingFactoryConstructor, but that is
currently broken for patch files.

It appears the VM has no patches of that kind, but dart2js does.

Change-Id: I0b64379f16089ad0d98ecd4df1ed9282ed6bc0e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98523
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-11 22:00:10 +00:00
Brian Wilkerson e6567601af Add a notice that the markdown file is generated and remove documentation specific to nnbd
Change-Id: Iece4cd98399b243c9d7fb69af888460bb45421fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105600
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-11 19:57:19 +00:00
Danny Tuppeny 1ba9ed7a35 Improve LSP JSON error when an expected object is not an object
Change-Id: I79632ceca51a5288f9b742f78483a6c2117f58d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105588
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-11 19:07:29 +00:00
Danny Tuppeny 9d5b4491b2 Remove redundant null checks from LSP validation
Change-Id: Ie978b598ecec85455628263d0e3cf2f6f8f71253
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105587
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 19:07:29 +00:00
Danny Tuppeny ca3320e3bd Tweak LSP JSON validation error messages
Change-Id: I732d0020a68256632ee8ba823a0a31eb4a5360d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105586
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 19:07:29 +00:00
Danny Tuppeny 972ea07459 Simplify LSP json error reporter with push/pop fields
Change-Id: I5186eb2de3cf956ada04237ac7ff90fc2d01b79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 19:07:29 +00:00
Danny Tuppeny 530a2f5681 Make a null LSP error reporter to avoid so many null checks
Change-Id: I08f9259ba5aca52c61dd6820a3cc54bf40a30c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105584
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 19:07:29 +00:00
Danny Tuppeny 9fb2842fce Improve the error messages reported in LSP when params are not valid
Change-Id: I305955a22d687e8338138db48dff4e32589bbc6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-11 19:07:29 +00:00
Konstantin Shcheglov 1b9d5b47ed Make sure that we have a unit in unit_withDirectives.
I still was not able to reproduce the issue, but I think this fixes it.

R=brianwilkerson@google.com

Change-Id: I209812bd2f2e8f0a5568ef14f7bfeaa4093c1341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-11 18:59:28 +00:00
Konstantin Shcheglov 8e9e1877b5 Perform AST rewrite during metadata resolution.
R=brianwilkerson@google.com

Change-Id: I3e19bb1bc6e7d6f3f42134090ed7e7a4920420ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-11 18:13:04 +00:00
Konstantin Shcheglov 149ebf683b Support for 'uri' property of Import/Export/CompilationUnitElement.
_Builder in source_gen uses code like this to check that the generated
file is expected in the library. While it is a questionable approach,
I don't feel that I have time to fix it, and remove the `uri` property
completely. So, we fix in in Analyzer with summary2.

`if (!library.parts.map((c) => c.uri).contains(part)) { ...fail... }`

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

Change-Id: I983f29589cbb2613d5f896b87f6218c31a47afa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-11 16:53:03 +00:00
Nicholas Shahan 8aa4414f1b [dartdevc] Ignore violation of empty_catches lint
* Only appears in a sourcemap test.

Issue: #37218
Change-Id: I0bb24db28c2d0041629de12c47273dfdc2b8b2f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105547
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-11 16:51:13 +00:00
Jens Johansen 801ad8b521 [cfe] Remember if finalizeExports was done
Before this CL, whenever a dill library builder was asked to compute
the outline it would finalize its exports - even if it was already done.
This is not really a problem (it mostly puts stuff into maps --- doing
it again will just overwrite what's already there with the same thing
again), but when having many dill library builders, and asking them to
compute the outline again and again because we've added a few new ones
(e.g. via kernel worker) it adds up to a lot of wasted time.

This CL adds a boolean to the dill library builders to avoid re-doing
this already done work.

An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(and lots of dill loaded dependencies) goes from ~149 seconds to
~143 seconds.

Change-Id: I19cadbf64ff5e0ff117bad4df86c83832a1f28fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105243
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-11 11:32:34 +00:00
Nate Bosch aa246f6588 Add return types on all main declarations
Reduces the noise when disallowing implicit dynamic.

Change-Id: I98b03cb675ecd4b9e7f4135efa274fb57eb87832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104164
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-11 00:19:00 +00:00
Stephen Adams ded6933b08 New Rti SSA nodes
Change-Id: I1448239274803ca3e1dae4c602996662a11f2f1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105408
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-11 00:02:12 +00:00
Sigmund Cherem 0960f72517 Fixes in modular test runner:
- ensure output directory has a trailing slash
 - ensure tests complete before returning from runner
 - flush log files (probably not necessary)

TBR=athom@google.com

Change-Id: Ie415266fd311d6319e0853a785e867770c0587a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105472
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-10 22:39:06 +00:00
Mike Fairhurst c167374232 Add Never*, use it in type provider etc
Change-Id: I8b7496a56d0479bdbcee3fd8a6e8937aeff8bb10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105471
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-10 21:29:04 +00:00
Brian Wilkerson 97dc7f4482 Support constructor declarations (issue 37196)
Change-Id: I276e897a02c999c7c1ab08d12f51e5bd9676bb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105543
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 20:56:36 +00:00
Brian Wilkerson ed9d185a9e Top-level getters do not have parameters
Change-Id: If8e079987f957538286afed162073fe4f323dea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105469
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 20:36:16 +00:00
Paul Berry 5ca5a53f64 Migration: Add support for generic function types.
Fixes #37212.

Change-Id: I3dfe0afa32564b9e4762f3410f5c44ea42d6d004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105467
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-10 20:29:59 +00:00
Paul Berry c2696591a6 Migration: Add more support for dynamic, clean up handling of void.
Change-Id: I0e83f614e58bcdbb4b1a37d20da4d97587d6bd5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 20:29:59 +00:00
Paul Berry 8b17b2e143 Migration: add support for null-aware accesses.
Change-Id: Ie034c0410e667f2e55fd2b9d9e9b2b3b3726de30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-10 19:53:06 +00:00
Paul Berry 881a2e9e48 Migration: remove unnecessary constructor argument
Change-Id: Ic544c37070d6ac3b874dc1a34d1709cf0949ff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 18:11:30 +00:00
Paul Berry eba533dcd1 Migration: Clean up handling of LUB and substitution nodes.
Previously we created artifical edges from a LUB node's components to
the LUB node; now the nullability propagation algorithm understands
how to propagate nullability downstream through LUB and substitution
nodes, so no artificial edges are needed.

Change-Id: Ib2fef14c3dcd58a013ad8e057fd55597a1deb4fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 18:11:30 +00:00
Brian Wilkerson c41e9ae0e8 Fix wording in spec
Change-Id: I468d0afa21102fc6fe6f30aa1c7bd0d1c46d8f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 17:24:35 +00:00
Paul Berry 0a0927de9c Migration: Separate the implementation from the NNBD migration engine's public API.
Change-Id: I0ea000b9068661d4e9122414320202ebd4f8563b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105413
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 17:10:45 +00:00
Vijay Menon b3b9aacc5f [dartdevc] enable testing on ff/safari/edge
Change-Id: Ice9cc8f4955561a7d36b7ab2bc7a0622cc4966b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105482
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-06-10 16:24:55 +00:00
Paul Berry 575a6424c3 Migration: Remove transitional API
Change-Id: I9853b7577ba4b39bf1d51f7d03ba3c2d6499e79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105412
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 16:18:05 +00:00
Paul Berry e23b00745f Migration: Move classes out of transitional_api.dart
This paves the way for removing the transitional API altogether.

Change-Id: I95181b04173d3439d278f898ae3b5ec574108b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105411
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 15:13:23 +00:00
Paul Berry 47865b7643 Migration: remove unused field Variables._graph.
It wasn't detected by the "unused field" hint because there is another
field in the same file with the same name that *is* used
(NullabilityMigration._graph).

Change-Id: I955f30d010ddaa2d218f61daf32978d391182708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105410
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 15:13:23 +00:00
Konstantin Shcheglov 4270982dd1 TypeSystem tests code motion.
Drop `Strong` prefix, extract LeastUpperBoundFunctionsTest.

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

Change-Id: I2ab28f23e28698f4c2063eb07362ae6df2938054
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-10 14:47:53 +00:00
Konstantin Shcheglov 0629ce94cc Change location where we set AnalysisDriver.useSummary2 in build mode.
We need to make sure that it is set when we create FileState(s).

Change-Id: I68103902d0f4df659291e02dd7809b2140b9af72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-10 14:47:03 +00:00
Brian Wilkerson f94628fb1b Convert the remaining diagnostics tests to test for location
Change-Id: I00fef7e7228bbe6d63c48267f42b5efc4900556d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105414
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 13:21:52 +00:00
Paul Berry 51046368c5 Move NNBD migration tool to a fresh package.
This gives us more flexibility for how we want to publish and deploy
the tool.  We now have the option, for example, of making a command
line app that invokes the tool and does not depend on analysis_server.

Note that some testing infrastructure had to be duplicated.  I plan to
consolidate this infrastructure in follow-up CLs.

Change-Id: I046506bc2bb5c3e467e15885f198ee0632351ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105463
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-09 17:45:35 +00:00
Brian Wilkerson 6c358d3ba6 Permissive mode reports the exceptions that were thrown and ignored
Change-Id: I1876577acc43ba076ff4eec3b2891e329c109c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105407
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-08 14:29:09 +00:00
Sigmund Cherem 586e05e415 Set exitcode on generic runner if no output log folder is provided.
This is a temporary way to ensure the bots will fail on these test suites until
the test matrix provides the output directory. At that point, the .json files
will be used to track test failures and the exit code is no longer necessary

TBR=vsm@google.com

Change-Id: Ie96c3835760de02addc89f7ccbcb3ccb04c21940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-07 22:59:49 +00:00
Sigmund Cherem fddecf659c Do not hide problems in kernel_sdk.dart
This addresses the most concerning problem in #37117

Change-Id: I38feb310023b066922a8049c5026a49572c3e399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105461
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-07 22:51:49 +00:00
Brian Wilkerson 9559e4d444 Initial documentation for a small sample of diagnostics and a script to generate a markdown file containing that documentation
Change-Id: I06602a29c95829b42add1d655ad8d7190ae7100a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 22:31:16 +00:00
Nicholas Shahan 80fb7891eb Cleanup violation of no_duplicate_case_values lint
Technically 'let' is an invalid identifier in ES6 strict mode.
http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors

We are never passing `strictMode = false` so either way it always returns true.

Change-Id: I7891202d76dce621ee314dc583c6a44f916ab5b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104382
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-07 21:59:06 +00:00
Sigmund Cherem efaec6449d Add --use-sdk support for dart2js and ddk modular tests
This allows the test runners to use snapshots instead of using the compilers
directly from source.

Change-Id: I70664a740bed8de647adb658bd521cd574aa685e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104385
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Sigmund Cherem f6d67a549b Turn ddc and dart2js modular tests into suites and share their test cases
For this to work properly, we first need the test infrastructure to have support
for the `--output-directory` flag (see base CL)

Change-Id: I75f788d19ad3b4e9523830250c4a1c9de8418cda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Nate Bosch 8614f86c9b Remove remaining support for dart:isolate on web
Closes #37153

Isolate.resolvePackageUri was the only API which had an implementation
across DDC and dart2js. The implementation in dart2js has been broken by
default since Dart 2.0.0 without a user implemented hook that is not
used on any public repo on github. Our current supported path for
invoking the compilers on projects disallows the import altogether on
the web and it is only usable with an older version of the
`build_web_compilers` package, or by invoking the compiler manually
outside of the build system. This CL does not break the ability to have
the import when invoking outside of the build system.

- Drop implementation for `Isolate.resolvePackageUri` from the dart2js
  and DDC patch files.
- Drop all references to `defaultPackagesBase` since it is not used.
- Drop all tests under `isolate/browser` since we do not expect any
  support on the web. Most of these tests would have already been
  failing. Remove status file entries that refer to the deleted tests.

Change-Id: I4a19213b0946d835c00e9c107a714f3bc5672f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-07 21:13:06 +00:00
Sam Rawlins 7a1af14458 Do not report that abstract methods should call super.
Change-Id: Ib365361c91b8b489c0d40c9097f2248ecca54176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105344
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-06-07 21:12:56 +00:00
Stephen Adams d10dffbfbf Add simple test to create dynamic
- Add testing entry points to create Universe
- Add creation of 'dynamic'

Change-Id: I54dd27b9a2f6c93a382c4927e6a306b11bcea96c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-07 19:40:12 +00:00
Brian Wilkerson 065c42705c Added an errors field to allow permissive mode to display the exceptions that are being ignored
Change-Id: Id8fd27a7882c6dd20854d055477af25d17de3582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-06-07 19:32:35 +00:00
Jacob MacDonald b7aa075ca2 add a --libraries-file option to ddk
Change-Id: If0698f5b3f3736fe597fbfe0a1d13cc4205c9575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105403
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 18:03:15 +00:00
Konstantin Shcheglov 2bba747ae3 Don't attempt to serialize FunctionExpression(s).
R=brianwilkerson@google.com

Change-Id: I18df1789eca4460edc40285a3fde08c81cdbe96d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105351
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-07 15:46:00 +00:00
Jacob MacDonald 8a57c1d463 handle range errors when getting locations
Bug: https://github.com/dart-lang/sdk/issues/37018
Change-Id: I7a9e0d4186abe37133ef29c719a81461e26cc54f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105340
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 14:37:20 +00:00
Paul Berry 15a3df3c10 Migration: add support for cascade expressions.
Change-Id: Iae52bef6a18c9536db3187102566423bc2f1dba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105325
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-07 13:39:49 +00:00
Brian Wilkerson da66902e4f Fix a bug in constructor element display string (issue 37165)
Change-Id: Ie5fe3b5c4e78be67887cf56e4698554d44095fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105349
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 13:21:59 +00:00
Paul Berry 85cadff46b Revert "Fix implementation of isDartCore and isDartAsync."
This reverts commit 0779751b82.

Reason for revert: Broke test unittest-asserts-release-win:pkg/analyzer/test/generated/resolver_test (see https://ci.chromium.org/p/dart/builders/ci.sandbox/analyzer-win-release/5691)

Original change's description:
> Fix implementation of isDartCore and isDartAsync.
> 
> It's not sufficient to check the name of the library, since a
> user-provided library could always name itself `dart.core` or
> `dart.async`.
> 
> Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

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

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

Change-Id: I7a27b46f4b2d1b3b43f9943933ec2a75b5a5b806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105346
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-07 12:29:09 +00:00
Dmitry Stefantsov 40ef0c6d9f Specify type of _location field in Widget Inspector Transformer
The change in the CL prevents the widget transformer from introducing
compile-time errors.

Change-Id: Ib4a73eb13fb33397daeb5d17c613c42a1d1a6025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105245
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-07 08:02:54 +00:00
Konstantin Shcheglov fd77972d8f Print time to prepare linking inputs.
R=brianwilkerson@google.com

Change-Id: I1e2779bb5468dd77a3551276796f5725900c1603
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105350
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 01:20:58 +00:00
Konstantin Shcheglov 8c9765c648 Clean up lazy_ast a bit.
R=brianwilkerson@google.com

Change-Id: Idf4ca6535088e5646474ac8728dbc6cff44eac4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105348
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 00:40:07 +00:00
Konstantin Shcheglov 6e0d978505 Build elements in default values.
R=brianwilkerson@google.com

Change-Id: I67c9e15832b28eeb49eeb7f8ecfd91734551b4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 22:38:21 +00:00
Vijay Menon 612a3f8978 [dartdevc] enable sdk compilation from dartdevc
Kernel mode only

Build with:
> dart bin/dartdevc.dart -k --compile-sdk dart:core --modules amd -o dart_sdk.js

For now, this doesn't support building only parts of the SDK - dart:core brings everything in.

Change-Id: I23cda3064408778dc93c9b3d4be757f1e99bae0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104811
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-06-06 21:59:21 +00:00
Konstantin Shcheglov 587806476f Remove parsed units caching for now.
I see that we leak them when using DAS.
So, lets remove them for now until we can do this safely.

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

Change-Id: Iaf349225c6e338eacb40e82deb5f84dfaa82e48d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 21:49:53 +00:00
asiva 7e9a4b786d [VM/benchmarks] Rework Dart2JSCompileAll test to instead do CFE compile all
The Dart2JSCompileAll test has not been working for a while due to
- issues with package config
- issues with getting the sources compiled with CFE after the switch to
  kernel pipeline.
Revised this benchmark/test to instead load the kernel_service dill file and do a CompileAll of CFE.

Should fix
https://github.com/dart-lang/sdk/issues/36630
https://github.com/dart-lang/sdk/issues/27369

Change-Id: I07f5c81fc6938d318b84fa9ea2fa033ec30a05e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103406
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-06-06 21:36:02 +00:00
Dan Rubel 41eea71a69 improve dartfix fix descriptions and add examples
Change-Id: I19c74bd9c55da29460ebe6f41b79e327429d6b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105323
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-06 20:23:48 +00:00
Dan Rubel b324850eae cleanup list of fixes in dartfix help text
This CL cleans up the displayed help text, better organizes and displays
the list of fixes that are or can be applied, and addresses
a comment in https://dart-review.googlesource.com/c/sdk/+/105002

Change-Id: I2e71001ae7eda61b3b01ce999cb9fdca968a9b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105322
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2019-06-06 19:57:12 +00:00
Samir Jindel c4541e63f8 [vm/aot] Update serializer for V8's "snapshot profile" format
Fixes https://github.com/dart-lang/sdk/issues/37183
Addresses https://github.com/dart-lang/sdk/issues/37126

Change-Id: I1c1e516ac2bcc45e46059f4439f16aaee6d824fe
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105302
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:54:12 +00:00
Paul Berry c130384c71 Migration: support assignments to fields and setters.
Change-Id: I4dbf43878f5cbf0a16a041e0975880c3d844fa13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-06 19:52:37 +00:00
Mike Fairhurst 527dffd21b Use StringSource in type provider tests to prevent bad path lookups.
Prevent windows from doing a path lookup for 'dart:core' which will
crash. All we need is a string source with a uri..

Change-Id: I742060633f3bd89323ad3e3f0f19ae80c1aedbae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104806
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-06 19:38:27 +00:00
Mike Fairhurst 09296499c2 Resolve type names in decls to * types in legacy libs
Change-Id: Icac40493e069d93abedc0422e77e3bcf29e965d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104960
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 18:45:20 +00:00
Konstantin Shcheglov 4bdd6e160b Compute unlinked API signatures from AST.
With this change summary2 does not use content hash as API signature,
so can reuse linked bundles when method bodies are changed.

The implementation of the API signature computation is from:
https://dart-review.googlesource.com/74925

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

Change-Id: I2a53957b8fff5208055aa28a188d6481ba24f5df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105321
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 18:22:50 +00:00
Brian Wilkerson 14b75b522b Remove some unused imports
Change-Id: I02b2ceba0bf545932e8e99c940bb2373d9eb75ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105320
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 17:18:37 +00:00
Brian Wilkerson 30390c6ba1 Prepare to compute the documentation URL for diagnostics
Change-Id: Ib1b7e4887e18b90c1552f3f8501948ee8d8d2c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 16:41:46 +00:00
Brian Wilkerson c34f74fd68 Update the minimum SDK constraint to allow the use of ui-as-code features
Change-Id: Iaa8e6bb3427f486c3432f76dac8e35052b5664ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 15:59:52 +00:00
Dan Rubel ba8e5f6535 list fixes when displaying help
This removes this --list option from dartfix and instead displays
the list of fixes when the --help option is specified.

Partially addresses https://github.com/dart-lang/sdk/issues/36875

Change-Id: Ibd8b124c2c20a752f7e661672eac8aa2e4483b26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105002
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-06 14:22:15 +00:00
Konstantin Shcheglov b9e877be78 Extract informative data from linked data.
So, that when changes to code that don't affect APIs are made, we
can use already linked bundles, and fuse it with informative data to
create elements with actual offsets and comments.

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

Change-Id: Ia0aa8af3c734b2cff497b49363064a26d601ebf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 14:14:10 +00:00
Konstantin Shcheglov 3bd2b03980 Issue 2972. Fix 'Wrap with...' for assignment.
R=brianwilkerson@google.com, pquitslund@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2972
Change-Id: I4dda6f73516d1715686884d55dc43405b36f3631
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 14:14:09 +00:00
Dan Rubel 4a27605fdc generate kernel experimental flags
Change-Id: I9430d95c012b752bc4ca0530d79252b8b032a26b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104841
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
2019-06-06 14:03:29 +00:00
Brian Wilkerson 3894b0896e Add partial code tests for extension methods
Change-Id: I5886c275383302566e997cb2f7e968c446b79369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105160
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 12:41:19 +00:00
Brian Wilkerson 7e933abe68 Convert more tests to include diagnostic location information
Change-Id: If0d0dec8839fd6f836cff2b5f021cc8c40969b0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 12:40:39 +00:00
Aske Simon Christensen c8ee114beb [cfe] Pass triple-shift flag to scanner.
Fixes https://github.com/dart-lang/sdk/issues/37082

Change-Id: I3aead7432b64433a040d4586623e13d8ac5388ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104004
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-06-06 12:00:24 +00:00
Jens Johansen 1e6f08d41c Fix crash when non-class is given as supertype
Before this CL this code would crash fasta:
```
class A extends Function() {}
```

Now it produces a compile time error instead:

```
t.dart:1:7: Error: Can't use a function type as supertype.
class A extends Function() {}
      ^
```

(technically it already issued it, but crashed before doing so).

Bug: #36824

Change-Id: Iaeb9dc8390d4a9ab7b473848c3311f08a4dbba6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101283
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-06 11:33:24 +00:00
Jens Johansen b4d190f5cd [incremental compiler] Streamline processing of reused/removed builders
Suprisingly this doesn't seem to affect performance, but doing basically
the same thing in two different ways is suboptimal.

Change-Id: I1cc52bceb05a0af4d0e0d0574c3599c063cf42a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105242
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-06 11:31:55 +00:00
Jens Johansen 5eff2a0374 Split CanonicalNameError, no warning if CanonicalNameSdkError
Prior to this CL, we would issue a warning whenever a CanonicalNameError
was encountered.
This is in principal a good thing, but because we currently have no way
to detect if the sdk we get is the one we expect
(by any other measure than when it issues a CanonicalNameError) we often
issue these warnings for no "real reason" whenever, for instance,
the flutter sdk changes.

This CL splits the CanonicalNameError in two such that errors with
references to the sdk ("dart:" libraries) issue CanonicalNameSdkError
instead, an we then handle that differently. Namely we silently ignore
the error (i.e. don't issue a warning) and just don't initialize from
dill.

This should remedy the situation and be strictly better than to always
swallow CanonicalNameErrors.

Bug: 36032
Change-Id: Idbae0b5ee5b9843a5dbeb49b3c65ae25f5962e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-06 10:10:46 +00:00
Brian Wilkerson 0c1c0afba3 Fix the documentation for ElementVisitor (issue 37151)
Change-Id: I03fbcb022bc92aaa88f65aeb895cad5de0b38e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105100
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:31:04 +00:00
Konstantin Shcheglov cabd3237f5 Build new elements for GenericFunctionType in DeclarationResolver.
It seems that we don't really need to have the same elements for them
for resynthesizing element model and resolved AST.

R=brianwilkerson@google.com

Change-Id: I05efdf90671f596f2f8b85a3808eb2c4c87ea8c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:09:50 +00:00
Stephen Adams 237d3ca398 dart2js: Add skeleton dart:_rti libary
- Skeleton Rti type
- Skeleton test
- Add dependency on command-line flag to get dart:_rti into platform dill

Change-Id: Idf383269c66c9951e23fd70a45ce65c54a973586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104921
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-06 01:02:20 +00:00
Brian Wilkerson 9efd0fa899 Use the right type provider based on the feature set of the library
Change-Id: I82a22cef142b89579c19e2063fb888e2827f2bb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104362
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 21:36:51 +00:00
Jaime Wren bbf0055a28 Follow up on recent computer_hover.dart changes, the containingLibraryName should not include relative paths from /.
Change-Id: I0fa25196e60eac694a09f3c71c36b2c09563c789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 21:35:03 +00:00
Alexander Markov 86ea9ad1e7 [vm/bytecode] Add source positions for more bytecode instructions
Also, correct source position for CheckStack instruction in the prologue of
a closure.

Change-Id: I175e5398296f17a1f67a223d45725206e65e0e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-05 21:06:56 +00:00
Nicholas Shahan 9cfe9bd34e [analyzer] Fix runtime error when creating SDK manager
Caused by a ternary operator with differently typed branches.

Change-Id: I5f9cfc28c274c125db0a999237f81dc3523896cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104240
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-05 20:44:56 +00:00
Paul Berry 9a061448a5 Migration: support assignment to index expressions.
Change-Id: I7f295247d059f532cabd24518f5009f017a34fd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104946
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 19:58:07 +00:00
Johnni Winther 74636a5777 Generate more fine-grained timing of the emission
+ emit a bit more progress info with -v

Change-Id: I60e44b2a383c8f55ef57c2a4cca98340baa66a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 18:44:02 +00:00
Dan Rubel 487326eef4 fix AstTextPrinter
This fixes a bug found in
https://dart-review.googlesource.com/c/sdk/+/105000

Change-Id: I9d2e12557ad506a1b5a433cdae35229c04affed4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 16:52:54 +00:00
Dan Rubel 9b22dd8e92 remove hard coded feature index
Change-Id: Ib01f2c9b1516987ec39591a5a320bab81138718d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104786
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 16:49:24 +00:00
Brian Wilkerson 37976dd26d Improve test so that snippet is displayed when an exception is thrown
Change-Id: Ib5a7ed985df42b7d56dd98e104a145fddc895599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 16:44:52 +00:00
Brian Wilkerson 788dcf681e Set or map literals can be ambiguous in invalid code
Change-Id: Ic17f5b80836bdf1891065af97adf5e9a5e021995
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 16:30:12 +00:00
Danny Tuppeny 94968f9bae Correct LSP completion relevance to add maximum boost instead of all boosts
Equiv change to https://github.com/JetBrains/intellij-plugins/pull/660.

Change-Id: I93192588de11afc1828b1f26e8f14f9b836cfd19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-05 15:24:22 +00:00
Paul Berry 42688f9d28 Migration: add support for reads from fields.
Change-Id: Iaa74a0d5d730df0a5ad57de839de01f1b54c1240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104807
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 14:25:50 +00:00
Paul Berry 2cd86030a5 Fix return value in GraphBuilder.visitVariableDeclaration.
This method should return `null`, since it doesn't visit an expression.

Change-Id: I018241c0d2e9b9f00bfe293352cf2707551c81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 14:24:20 +00:00
Dan Rubel 9197b34a0e generate analyzer experimental flags
Change-Id: I7dc2be03e7266b6ef0a936269a2dbe584096e3db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104785
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 14:17:35 +00:00
Dan Rubel 4181185070 parse nullable function typed formal parameter
Change-Id: I502d4c6649a8974883b9ded038ce8927d34eea10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 13:37:01 +00:00
Johnni Winther 682ffb6e7a Handle unevaluated constants in annotations
Change-Id: Icbcdac10ea5aabedbeebd7953134d297ab6c1d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104561
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 13:05:00 +00:00
Paul Berry 79989d2627 Migration: recognize /*?*/ as expressing nullability.
Change-Id: I132d15775bb55ca4772a7b48f6a85c12c930a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104880
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 12:41:41 +00:00
Paul Berry 4402fbe672 Migration: support index expressions.
Change-Id: Ie43b5045df75b325a74243a8ae8801387c73c64a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 11:49:52 +00:00
Danny Tuppeny a684f2051b Reduce JSON for LSP completions by moving edits to resolve
See https://github.com/dart-lang/sdk/issues/37163.

Change-Id: I336245590560f7b30315a1dbda59ea56e5e9e043
Bug: https://github.com/dart-lang/sdk/issues/37163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104862
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-05 06:47:51 +00:00
Danny Tuppeny 2f0c9904ee Remove docs from LSP (suggestion set) completions and provide during resolve
Change-Id: I1e3c99e3076e829822b418ffaf19dcb891e93f81
Bug: https://github.com/dart-lang/sdk/issues/37163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 06:47:51 +00:00
Danny Tuppeny 91b3281531 Reduce LSP completion JSON by removing optional fields set to defaults
This addresses some of the things mentioned in https://github.com/dart-lang/sdk/issues/37163 but doesn't entirely solve the issue (for example it doesn't touch docs yet).

Change-Id: Ib0a094695905120ac5e222dae52165b9a5f9a825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 06:47:51 +00:00
Brian Wilkerson 6031ca4116 Remove an unused import from the LSP support
Change-Id: I7fc72f249c18688cd8262f73ccd9c14aea45f908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104943
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Danny Tuppeny <dantup@google.com>
2019-06-05 06:47:21 +00:00
Konstantin Shcheglov 37b714401d Add AvailableSuggestion.declaringLibraryUri
We need this to support existingImports filtering, because filtering
is done on suggestion basis, not on the whole suggestion set basic,
because of re-exports.

R=brianwilkerson@google.com

Change-Id: Id97cb122fa6e3c5c62e367098e1917eba997a76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104808
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 01:20:51 +00:00
Konstantin Shcheglov cf4a9f4f75 Revert "Restore explicit SimpleIdentifier."
This reverts commit bb6e558534.

I found a problem with --use-summary2 in DAS.
When we implement actual API signatures, changes in bodies
change offsets for nodes, but summary2 also includes offsets,
and they don't match. So, DAS crashes. I will need to rework
offsets and other @informative data storage, so its turns
out that we cannot pretend so use real SimpleIdentifier(s)
anymore.

R=brianwilkerson@google.com

Change-Id: I1193cc3f6fd25aea1c39531e8a685b60b347166e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 00:34:22 +00:00
Brian Wilkerson f7526daebd Fix a hint in the migration engine
Change-Id: I119c44b30a1d3c6fb0d725ddb546cd3dcb31dab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104809
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 22:18:43 +00:00
Paul Berry fa19cd7bb8 Migration: handle simple assignment expressions (x = y).
Change-Id: I580b902e83325a7a0a85686ebf7393993e531446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 17:12:01 +00:00
Paul Berry 74b7165cc8 Migration: support references to local variables.
Change-Id: I43c4e2882c003b9cb219406c2aaac507b7f63979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104802
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 17:03:56 +00:00
Danny Tuppeny 64a9253763 Add LSP method to fetch super method/class for a position
Change-Id: If8f28a708312113916cc9cecd75e768f7fec393b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-04 16:05:15 +00:00
Paul Berry 15c0315e8e Migration: add support for local variable declarations.
Change-Id: Ifead9354c583a070a7240d158823eafe1be3d875
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104840
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 15:53:25 +00:00
Paul Berry 46dd19609e Migration: recognize /*!*/ as expressing non-null intent.
Change-Id: Ic9f0b3f560df00adf5e7cbab71b3380f6c43c0aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 14:54:29 +00:00
Paul Berry 53de6054d9 Add a missing migration test case for binary expression
Change-Id: I996976d2247b3b19670f02dd9d3577cc7d8c1fdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 13:49:29 +00:00
Vijay Menon 3b5a187726 [dartdevc] move ddc internal libraries under sdk
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.

This should enable https://github.com/dart-lang/build/issues/2262

Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-04 13:47:29 +00:00
Danny Tuppeny 9a3478ac20 Add support + tests for closing labels
Change-Id: I415a352010044d3b4aeb156d9d11dbbd94e86461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104782
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-04 13:35:57 +00:00
Danny Tuppeny 0200a1e7b2 Extract LSP initializationOptions into a class
Change-Id: I50402bb75f51a771931d9b5255b7b9207d0f316b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-04 13:35:17 +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
Jens Johansen 422553798e [incremental compiler] Don't process dill libraries twice
An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(and lots of dill loaded dependencies) goes from ~160 seconds to ~150 seconds.

Change-Id: I80afa10caacef5e14e569928a1d421bd3e8ab342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104003
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-06-04 11:33:29 +00:00
Paul Berry 0779751b82 Fix implementation of isDartCore and isDartAsync.
It's not sufficient to check the name of the library, since a
user-provided library could always name itself `dart.core` or
`dart.async`.

Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 03:12:28 +00:00
Konstantin Shcheglov d24b407568 Add --use-summary2 flag to AnalysisServer.
So that we can start dogfooding it.

I noticed that we logged too much data, so I reworked what we
log in LibraryContext.

Currently performance will be subpar, due to using content hash as
file's API signature. So, any change to a file, even in a method
body will cause the whole library cycle (and everything that depends
on it) invalidation. I will implement computing API signatures for
parsed unit (hopefully reusing something already existing) in a
following CL.

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

Change-Id: Ifb77e29188484b6784edbaa6a6d5daca6800ef2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104603
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 02:58:29 +00:00
Mike Fairhurst 55d3bbf13f Promote parameter of == to nullable when invoked.
This is required because otherwise

Object() == null

requires the type signature of Object.operator==(Object o) to be
changed to Object.operator==(Object? o). Which I don't think is the
behavior we want.

Confirmation that this CL is correct has been sent to the language
team. I recommend we land, which will unblock my subtyping CL, and
roll back/readdress later if need be.

Change-Id: I498f9870e7128b2cac3012fff0cb1ab50fcc8df7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104344
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 00:36:24 +00:00
Nate Bosch 0241e40c15 Track Library URI for classes
Closes #36771

- Add getLibraryUri and setLibraryUri runtime utility.
- When emitting classes add a statement to set the library URI.

Change-Id: I8974c7fdd4d9986f27a35f116d9881af043c0c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104641
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-03 21:47:17 +00:00