Commit graph

23317 commits

Author SHA1 Message Date
Kevin Moore a60a06ff7d Update pkg:expect to use @alwaysThrows annotation on fail functions
Change-Id: I4e87b2044fe429b42d8e96213f415437a7f2d1da
Reviewed-on: https://dart-review.googlesource.com/c/89421
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-01-14 21:17:38 +00:00
Konstantin Shcheglov fafd3d0f18 Make bottom, dynamic, void types nullable. Add withNullability() method. Apply proposed substitution rules for type parameters.
This is a portion of https://dart-review.googlesource.com/c/sdk/+/89080,
but only with types change, without resolution changes.

Change-Id: I41af50089974928e58fb32ecf6622076cd9e3d5b
Reviewed-on: https://dart-review.googlesource.com/c/89172
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-14 21:10:37 +00:00
Konstantin Shcheglov 7bac8e631f Issue 35551. Log more information to debug the issue.
I don't know how to reproduce this issue.
So, I have to add logging to gather more information.

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

Bug: https://github.com/dart-lang/sdk/issues/35551
Change-Id: I6c7de530a76998697577bd088f74bd2e9ac79cc4
Reviewed-on: https://dart-review.googlesource.com/c/89420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-14 21:09:37 +00:00
Konstantin Shcheglov 957f3e239e Restore including transitive files into exception dumps.
We need this data.
RE https://github.com/dart-lang/sdk/issues/35551

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

Change-Id: I55e4a83f07eda618e857ac8a577c254a51a82219
Reviewed-on: https://dart-review.googlesource.com/c/89400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-14 20:04:39 +00:00
Jenny Messerly 9df4f42a2f [dartdevc] handle a null stack trace passed to async errors
Under certain conditions, we receive a null stack trace passed to a then
callback of an awaited Future. If that happens, the original stack trace
is now recovered from the error object. This matches dartdevc behavior
prior to the commit f68ae70e8e, for this
case. Fixes #33331

Change-Id: I8a4a295bdde18d4339420a7ba6443d83d4e00abb
Reviewed-on: https://dart-review.googlesource.com/c/89060
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-01-14 19:57:24 +00:00
Samir Jindel 4d77c7b3a6 [vm] Remove redundant type-checks from core libraries.
In conjunction with previous revisions, this improves several Flutter microbenchmarks by 2-4%.

Change-Id: Ic864fd586dc57d87b80cebd6ceace0a8165fa82b
Reviewed-on: https://dart-review.googlesource.com/c/88702
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-14 19:56:37 +00:00
Konstantin Shcheglov 6c76fe21b5 Issue 25860. Fix for changeFile() directly after removeFile().
Reverts 561d892d29

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

Bug: https://github.com/flutter/flutter/issues/25860
Change-Id: I2a7d725d3637754c096b088c85e862ec2917dc71
Reviewed-on: https://dart-review.googlesource.com/c/89380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-14 19:17:13 +00:00
Danny Tuppeny 8cddcd20cd Handle deserialising sub-classes in the super-classes fromJson
Change-Id: Ib9048cf674ad77711401e77e20e6dd8bc7e28e00
Reviewed-on: https://dart-review.googlesource.com/c/89363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-14 18:35:27 +00:00
Danny Tuppeny 28fe86d70f Add implementation/tests for LSP rename
Change-Id: I28e45cb7c979edb3d64b17e86ad0e03b7cd746cd
Reviewed-on: https://dart-review.googlesource.com/c/89361
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-14 18:12:47 +00:00
Danny Tuppeny f5c69070af Minor LSP refactors/tidy up
Change-Id: I7402d9493c58b1e020655a3b6332edbb5425fc22
Reviewed-on: https://dart-review.googlesource.com/c/89360
Commit-Queue: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-14 17:30:45 +00:00
Danny Tuppeny 32eea54390 Extract rename element logic to allow sharing with LSP server
Change-Id: I3569af7e960c294078ffa5e026ad2e1c2371c6e3
Reviewed-on: https://dart-review.googlesource.com/c/89281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-14 15:05:13 +00:00
Danny Tuppeny 4f160558b3 Extract inline interfaces from results definitions in LSP spec
Change-Id: I8661c7af628f0e3125db0613149bbcbc9f27bbe6
Reviewed-on: https://dart-review.googlesource.com/c/89301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-14 15:04:13 +00:00
Greg Littlefield 085f31ac5f Library import quick-fix: support calls to top-level function variables
Fixes https://github.com/dart-lang/sdk/issues/34374

Change-Id: I6878d443afa2c70e3833fe4ed2118b28878b3210
Reviewed-on: https://dart-review.googlesource.com/c/89171
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-14 14:54:11 +00:00
Kevin Millikin 1c83d8d096 [Kernel] Allow invalid expressions in constant contexts
A simple solution is to leave them unevaluated.

Change-Id: Ic7d1237452a387180ec12f23b3a4030ff64f061d
Reviewed-on: https://dart-review.googlesource.com/c/89282
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-14 13:30:00 +00:00
Peter von der Ahé 950b92104d Extract method reportInheritanceConflict
Change-Id: Iea1808c45a1380feaf0c298c341f00c74cde7c57
Reviewed-on: https://dart-review.googlesource.com/c/88940
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-14 13:06:30 +00:00
Peter von der Ahé 6e13f3334d Abstract noSuchMethod might not be an error.
Change-Id: Ie17371338a79d416f5bb8ccbae2b22cc2021a5b0
Reviewed-on: https://dart-review.googlesource.com/c/88835
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-14 13:06:30 +00:00
Kevin Millikin 1c9eb3cef8 [Kernel] Allow constant declarations without an initializer
These can arise in erroneous cases which have already been reported,
e.g., in a for-in loop with a const declaration.  The constant
evaluator should not assume a non-null initializer in this case.

Change-Id: I2540cb9c659d33e23b6c00d4a8bbf56c404d8c1d
Reviewed-on: https://dart-review.googlesource.com/c/89280
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-14 11:40:10 +00:00
Kathy Walrath 8d9247b9fc dartfix README
@danrubel What do you think of these as docs? (It's pretty close to what I wrote for www.dartlang.org, before I realized that it's too early to document dartfix there.)

We talked about having a separate page per fix, but I figured we could do that in a future PR.

Closes dart-lang/site-www#1229

Closes #35628
https://github.com/dart-lang/sdk/pull/35628

GitOrigin-RevId: 582cd58ea1457bc62ac0a3aeac61affa8abfcc37
Change-Id: I9dca2777b8ed8707fc3e37b04e13b5a2be7b7f65
Reviewed-on: https://dart-review.googlesource.com/c/89061
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2019-01-13 02:26:05 +00:00
Johnni Winther f81dd1da9f Handle super* in ir/impact.dart
Change-Id: I91a5f76f45e1f3d5248b31322e107a5dc00d69af
Reviewed-on: https://dart-review.googlesource.com/c/89150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 22:44:06 +00:00
Stephen Adams 99a9ae66c3 [dart2js] run dartfmt --fix-doc-comments on stragglers
Files outside of pkg/compiler/lib/src

TBR=sigmund@google.com

Change-Id: Ic322c7bcca2e0203bdc48f06abdc69842724ae29
Reviewed-on: https://dart-review.googlesource.com/c/89165
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-01-11 22:19:06 +00:00
Stephen Adams f0c7d971c4 [dart2js] Run dartfmt --fix-doc-comments
Change-Id: I004a5da3f3e3adb5fc6f3088ba8dc3ca5082fbef
Reviewed-on: https://dart-review.googlesource.com/c/89163
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 21:13:17 +00:00
Alexander Markov d821a2ec96 [vm/aot/tfa] Correctly tree shake initializers of write-only fields
Fixes https://github.com/dart-lang/sdk/issues/35632

Change-Id: I9736268087a90fd409509f35bf2fc0637443a9fb
Reviewed-on: https://dart-review.googlesource.com/c/89161
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-11 20:46:30 +00:00
Brian Wilkerson 3c5501a090 Add the experiment flags for the control flow and spread collection features
Change-Id: I8077794ae5cc42b13aff678c010a0564025e96ac
Reviewed-on: https://dart-review.googlesource.com/c/89045
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 19:47:46 +00:00
Sigmund Cherem e636e1fa6f Accept experimental flags in dart2js and enable set-literal tests, now supported
once we accept the flag.

Note: 3 tests are missing compile-time errors from the CFE. This is a known CFE
issue, we need to mark the tests as failng using the new workflow before we land
the CL.
Change-Id: I0eaf6c1d7e903e035c83d3338054a8f92d2d9296
Reviewed-on: https://dart-review.googlesource.com/c/88763
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-01-11 19:32:46 +00:00
Sigmund Cherem 7cea3cba29 Several dump-info fixes.
Includes:
 * avoid prettyPrint in dump-info (which removes inconsistencies from shadowing
   when using fast-startup), instead log start and end offsets and record the
   emitted string.
 * fix startup emitter to track a few more things (class names, inherit calls,
   lazy initializers, etc)
Change-Id: I213edf526173212e918129440dc6dec996a9dd55
Reviewed-on: https://dart-review.googlesource.com/c/89084
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-01-11 18:47:55 +00:00
Brian Wilkerson 68ad94cebe Extract more hint tests into separate files
Change-Id: I110f815c6bb124596b31cf3bac739ed8604d6c3b
Reviewed-on: https://dart-review.googlesource.com/c/89100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:39:16 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Aske Simon Christensen 1842020a69 Fix empty set/map literal disambiguation rule.
The criterion for an empty set/map literal without type arguments to
become a set literal was implemented as "superclass of Set and not
superclass of Map". This CL changes it to the rule now stated in the
spec: "subtype of Iterable and not subtype of Map".

Change-Id: I52d3a11e29ed9b1feb0f2b52a3f4beebe3833e31
Reviewed-on: https://dart-review.googlesource.com/c/88828
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-11 15:14:05 +00:00
Aske Simon Christensen 6a756ac040 Add front-end test for set/map literal disambiguation.
The test exposes three problems:

- The disambiguation criterion in the type inference is incorrect, as
  it infers a map when the context is a LinkedHashSet. This will be
  fixed in an upcoming CL.

- Assigning a map literal to a LinkedHashMap produces a static error
  ("isn't of expected type") due to exact types. Rules for exact types
  are currently unspecified, and the language team has expressed some
  interest in allowing this case. See also
  https://github.com/dart-lang/sdk/issues/33307

- Type arguments for the map literal are not inferred from the context
  when the outer context type is a LinkedHashMap. This is consistent
  between the CFE and analyzer. If the LinkedHashMap case is to be
  supported, this must be fixed as well.

Change-Id: I1519c844dae1f599306446c992cfe4825e4f20d4
Reviewed-on: https://dart-review.googlesource.com/c/88726
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-11 15:14:05 +00:00
Aske Simon Christensen 76be911f22 Enable set literals by default in the front-end tests.
Set literals can be disabled in individual suites by putting
"enableSetLiterals": "false" into the environment given to
FastaContext.create.

Also fixed a missing file offset on inferred empty set literals
which would trip up the front-end tests.

Change-Id: I76ad03e6ed03eb80045055f83fa0ab9acd62eed6
Reviewed-on: https://dart-review.googlesource.com/c/88722
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-11 15:14:05 +00:00
Peter von der Ahé 03098c1505 Implement DillClassBuilder.mixedInType
Change-Id: I5b19eba3decbfc40e00c9bdec2ba4d60cbe8cf79
Reviewed-on: https://dart-review.googlesource.com/c/88833
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-11 12:45:43 +00:00
Peter von der Ahé 4547066f4b Tweak Declaration API
Change-Id: I5a6f9b94cf9114ed7ab2c715b9a99cc31a64f9b0
Reviewed-on: https://dart-review.googlesource.com/c/88832
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-11 12:45:43 +00:00
Peter von der Ahé c3b13ae5c1 Collect abstract members immediately instead of counting.
This simplifies diagnosing missing implementations, especially, the
ones inherited from interfaces.

Change-Id: I13705eee07960974a111d78f1eb986e77d27a468
Reviewed-on: https://dart-review.googlesource.com/c/88719
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-11 12:45:43 +00:00
Peter von der Ahé deb9239790 Compute type arguments of dill types.
Change-Id: I6d83ff53d7d56b2c50c221b9dd0d4ff8f0d2a5b7
Reviewed-on: https://dart-review.googlesource.com/c/88718
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-11 12:45:43 +00:00
Peter von der Ahé c41611d35b Add non-final fields to setters
Change-Id: Ib42064cf762dae6eb0ff5bda4459ce69a9f78b26
Reviewed-on: https://dart-review.googlesource.com/c/88717
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-11 12:45:43 +00:00
Johnni Winther b61a085c60 Use custom thisType to signal static type precision.
This also removes the dependency on the state (!) in ir.TypeEnvironment.

Change-Id: I0180d111ecf45b685c4abce12c6a9bd52c1f308e
Reviewed-on: https://dart-review.googlesource.com/c/88968
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 12:17:14 +00:00
Dmitry Stefantsov 9157bbcf19 [kernel] Add text (de)serialization for VariableSet
Change-Id: Ib49aae4ee0f5ba1ff809dbf8b8ff0bc1c16e6838
Reviewed-on: https://dart-review.googlesource.com/c/89121
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-01-11 12:16:43 +00:00
Kevin Millikin 1314a6dbf7 [Kernel] Do not evaluate fromEnvironment constants
Instead of evaluating them to their default value, leave them
unevaluated.

Change-Id: Iefc7701b9993cae8f7f1eee37d904d21a89a1cd8
Reviewed-on: https://dart-review.googlesource.com/c/89002
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-11 10:23:51 +00:00
Aske Simon Christensen 90d22365d1 Convenience function to parse a list of experimental flags
Change-Id: Iaf25e53136bbe740756c7b047976a2483a12c8df
Reviewed-on: https://dart-review.googlesource.com/c/88840
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 10:07:29 +00:00
Johnni Winther 7b2aae5498 Handle dynamic/instance access in ir/impact.dart
Change-Id: Iaae339550bc5f693d592012e1798c9e64002f4ec
Reviewed-on: https://dart-review.googlesource.com/c/88965
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-01-11 09:30:38 +00:00
Johnni Winther 5cb13961db Use typeEnvironment.nullType for null and custom type for 'does not complete'
Change-Id: Iab2baf491227c722c8bafe3dfede44907bc0d09a
Reviewed-on: https://dart-review.googlesource.com/c/88961
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 09:30:38 +00:00
Johnni Winther 5340fea835 Move more parts of impact builder to ir/impact.dart
Change-Id: I64ef1add990548208f2eda28c8486d88f00504a3
Reviewed-on: https://dart-review.googlesource.com/c/88950
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 09:30:38 +00:00
Johnni Winther cff0d20247 Use better static types for RuntimeTypeUse
+ remove the use ir.Expression.getStaticType

Change-Id: I4fa7908e44505b9336cd366a2025f20a7ba45a59
Reviewed-on: https://dart-review.googlesource.com/c/88834
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 09:14:27 +00:00
Kevin Millikin 944984f015 [Kernel] Add syntax for unevaluated constants
Add Kernel syntactic support for constants constructed by
bool.fromEnvironment, int.fromEnvironment, and String.fromEnvironment.
These values are not necessarily available at compile time.  Because
constants can depend on these values, there is also an unevaluated constant
that represents an expression depending on environment values.

This syntax is not yet produced by the Fasta compiler.

Change-Id: Ie96ea7f60a7efcd35ac802b320a00f398d41232e
Reviewed-on: https://dart-review.googlesource.com/c/88827
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-11 08:35:20 +00:00
Johnni Winther 3d7ca147a4 Add FeaturesDataInterpreter
Change-Id: I40a7baca235c2e729629f4330d8d51f148264ece
Reviewed-on: https://dart-review.googlesource.com/c/88963
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-01-11 08:11:09 +00:00
danrubel 3f90e88288 first cut adding simple non-nullable migration to dartfix
... and address comments in https://dart-review.googlesource.com/c/sdk/+/88640

Change-Id: I26e0f70f7c112d9ac184e10475e519afd8118a1d
Reviewed-on: https://dart-review.googlesource.com/c/89046
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-11 01:59:59 +00:00
Sam Rawlins 16e98d012d Update BasicWorkspace's docs and tests
Change-Id: I7c2977ae63ec983ba71e31a75b2c3a13d89991c6
Reviewed-on: https://dart-review.googlesource.com/c/89083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-01-11 01:11:18 +00:00
Stephen Adams e2e2a85744 [dart2js] Add --no-minify flag for compiler devs
Change-Id: Iec1600c801087b4dd836d833f515b4cb728f78d5
Reviewed-on: https://dart-review.googlesource.com/c/89082
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-01-11 00:41:19 +00:00
Sigmund Cherem a1ff5f7cd5 Ensure inlining of getter/setters is recorded in our source-map extension
Change-Id: I6eac59f756b2a6a87842e5a4b1d8aa47df619042
Reviewed-on: https://dart-review.googlesource.com/c/88580
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-01-10 23:40:28 +00:00
Stephen Adams d44ec3a57e Remove full emitter version of Function.apply
Change-Id: Ib6abb717c815ec97964943c992d9cfd0d4dceec9
Reviewed-on: https://dart-review.googlesource.com/c/88884
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-01-10 23:16:51 +00:00
Jenny Messerly 60cf393ff3 [dartdevc] fix to pass in analysis options to analysis context
Also switch to using the RestrictedAnalysisContext.

Change-Id: Ia9a07331592a3eaacacddb8b27ca08598d2c0773
Reviewed-on: https://dart-review.googlesource.com/c/88749
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-01-10 22:49:09 +00:00
Mike Fairhurst 161f9b35c7 Use preparsed experiment status in Static Type Analyzer
Change-Id: I67b3442f00aed8779806c5aa532ec5e1fdaecf7b
Reviewed-on: https://dart-review.googlesource.com/c/89022
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-01-10 21:59:16 +00:00
Konstantin Shcheglov 29b34fa63f Set nullability for TypeName(s) based of ClassElement.
I have not tried function types yet.

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

Change-Id: I7decfe7bc6d2a09c11cdc2861ab9aaefa7bc1842
Reviewed-on: https://dart-review.googlesource.com/c/88886
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-10 20:53:30 +00:00
Konstantin Shcheglov bb025bfac4 Use target file in CREATE_CONSTRUCTOR fixes.
Accidentally triggered an exception while.

R=brianwilkerson@google.com

Change-Id: I0c411378ce49388e0c2db197a408a4a43d8814b9
Reviewed-on: https://dart-review.googlesource.com/c/89040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-10 19:02:06 +00:00
Danny Tuppeny 5966565f0e Re-sort file and move TODO to where it was originally
Change-Id: I13e3acf808f6174c920d725bd4c4709a0d0352b8

Move TODO back correct code

Change-Id: If2a137e318062c4b1ff6620ed49184d3cdbc5886
Reviewed-on: https://dart-review.googlesource.com/c/88969
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-10 17:48:54 +00:00
Stephen Adams 4ef8de99ac Remove full emitter
Change-Id: Iaabca4423570a851bf7d8969d1829c81c94850a8
Reviewed-on: https://dart-review.googlesource.com/c/88882
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-10 17:38:34 +00:00
Brian Wilkerson 6712dca7d8 Fix the test used to differentiate between empty sets and empty maps
Change-Id: I128c356cee02397ff7f5ee9030f3c2de95dfbce9
Reviewed-on: https://dart-review.googlesource.com/c/88741
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-01-10 16:28:14 +00:00
Danny Tuppeny c76fa45178 Add an analysis server diagnostics page for LSP capabilities and completions
Change-Id: I97fff735dddf24da4da4769309198f82fba66578
Reviewed-on: https://dart-review.googlesource.com/c/88964
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-10 15:15:40 +00:00
Danny Tuppeny 4a80990758 Implement LSP textDocument/documentHighlight
Change-Id: Iaa63791192e274a7ef8f2f4095e2984b27d95e05
Reviewed-on: https://dart-review.googlesource.com/c/88962
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-10 15:02:11 +00:00
Danny Tuppeny 44449e29d2 Add a custom toJson snippet for LSP ResponseMessage for null handling
This adds some custom code for serialising ResponseMessage to ensure that only one of result or error are ever specified, as required by JSON RPC.

Change-Id: I2736b83755553a906264b1e5251d1a535dc289fb
Reviewed-on: https://dart-review.googlesource.com/c/88953
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-10 14:46:30 +00:00
Danny Tuppeny 7e0d65706f Include null in allowed types for any and prefer null to omitting values if allowed
Without this, some requests that don't return values (like shutdown) would omit the `result` field from the response and this wasn't strictly correct (and caused an issue in testing with the VIM plugin).

Change-Id: Id961135d326b997aea69e29d9d2a4a2c310fa60c
Reviewed-on: https://dart-review.googlesource.com/c/88839
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-10 14:46:30 +00:00
Dmitry Stefantsov 59b252fa0a [kernel] Add text serializer/deserializer for VariableGet
Change-Id: I884190dffbca5eb5181f21bc12972b375e31de65
Reviewed-on: https://dart-review.googlesource.com/c/88724
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-10 14:20:01 +00:00
Jens Johansen e0ede8791f Fasta: Set fileEndOffset on Fields
Bug: #34742
Change-Id: Ia20acd0f30cbc64db875e756e1be7e053b9abf9b
Reviewed-on: https://dart-review.googlesource.com/c/88951
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-01-10 11:39:57 +00:00
Jens Johansen 705701951a Small cleanup in incremental compiler
Change-Id: I4ea16c95e6406b7bea73669d159c83c4c23b9802
Reviewed-on: https://dart-review.googlesource.com/c/88700
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-10 10:14:11 +00:00
Jens Johansen 05673b80fc Suggest uploading dill file when failing to initialize from dill
Change-Id: I5cbc9ef08581206035b6af3a4fa71d1b6b0bca98
Reviewed-on: https://dart-review.googlesource.com/c/88572
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-10 09:41:21 +00:00
Johnni Winther d00f1e7e8e Introduce kernel based impact builder
This is a step towards computing impact modularly without the need for a K-model.

Change-Id: Ie94ff7bc73b409acc99abe58b74502541ae5218f
Reviewed-on: https://dart-review.googlesource.com/c/88824
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-01-10 08:15:37 +00:00
Konstantin Shcheglov 0109e39ca4 Report INVALID_ASSIGNMENT for prefix/postfix increment decrement when the result is not assignable to the operand.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I83a732c039c1c83599c068a1944c5dd1040c3fd5
Reviewed-on: https://dart-review.googlesource.com/c/88880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-10 05:51:15 +00:00
Peter von der Ahé e7495724b9 Remove TypeEnvironment.hierarchy
Change-Id: Ia32e2c0beb504e38f8dcb9bae33f4ee9f0e7daca
Reviewed-on: https://dart-review.googlesource.com/c/88825
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-10 05:21:24 +00:00
Peter von der Ahé 8e5ad9b3bd Prepare the VM for removing TypeEnvironment.hierarchy
Validating the class hierarchy requires subtype tests. Previously,
Fasta has worked around this by computing the hierarchy twice, as
well as visiting the hierarchy several times. In order to improve
performance of modular compilation, we're working on changing this.

To enable creating a TypeEnvironment without a hierarchy, we're
removing the field from the API.

Change-Id: I7c9f88d5c6495aaa8223eaeff7d2dfd5669e9e95
Reviewed-on: https://dart-review.googlesource.com/c/88823
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-10 05:21:24 +00:00
Peter von der Ahé 7ac495e02a Prepare DDC for removing TypeEnvironment.hierarchy
Validating the class hierarchy requires subtype tests. Previously,
Fasta has worked around this by computing the hierarchy twice, as
well as visiting the hierarchy several times. In order to improve
performance of modular compilation, we're working on changing this.

To enable creating a TypeEnvironment without a hierarchy, we're
removing the field from the API.

Change-Id: If1aa10598012e53455b92a63ebae12dbae316fc7
Reviewed-on: https://dart-review.googlesource.com/c/88822
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-01-10 05:21:24 +00:00
Mike Fairhurst ca9ea997bd Fix old treatment of {}, enable set literals tests
Change-Id: Iec319cb735a3747e64561f3865cce2f08fb2be0f
Reviewed-on: https://dart-review.googlesource.com/c/88601
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-01-10 01:38:34 +00:00
Stephen Adams 651d19cdaa Ignore --fast-startup flag, assume true
Change-Id: I7a41160bf7f5bb403177b19613de2889e0fa2b44
Reviewed-on: https://dart-review.googlesource.com/c/87424
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-09 21:22:57 +00:00
Brian Wilkerson aeb7fccd5b Fix plugin start up to work with OverlayResourceProvider
Change-Id: I9444f6787b9a549f112b997a6173abf12e6b110a
Reviewed-on: https://dart-review.googlesource.com/c/88860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-01-09 20:10:31 +00:00
Danny Tuppeny 36b5fe0c7a Track how many analysis server requests had latency info
This makes the latency numbers more accurate if they're not available for all requests and also doesn't show them if no requests had latency info (rather than showing average of 0ms).

Change-Id: I6db5543a782025a8133077b33f1228cce952b387
Reviewed-on: https://dart-review.googlesource.com/c/88802
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-09 17:41:49 +00:00
Danny Tuppeny bf13ac85c4 Ensure LSP server clears diagnostics for removed files/analysis roots
Change-Id: I5eaa4141da499c5193253440e6913a0eb92ed533
Reviewed-on: https://dart-review.googlesource.com/c/88836
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-09 16:17:12 +00:00
Danny Tuppeny 54fffe4cca Add support for LSP workspace/didChangeWorkspaceFolders
Change-Id: I55401d0abf65979fcd446b2ba1e8d9b6c09a42fc
Reviewed-on: https://dart-review.googlesource.com/c/88831
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-09 16:04:12 +00:00
Danny Tuppeny e7b783ba5d Fix bug with deprecated rootPath + add tests
Change-Id: I53d0a9b9a367839cc4ecf463017463f343947dfc
Reviewed-on: https://dart-review.googlesource.com/c/88826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-09 16:04:12 +00:00
Danny Tuppeny ad300b904d Improve handling of server-specific analysis diagnostics pages
Change-Id: I0c133860d438ee848203a537eceb520595532a2c
Reviewed-on: https://dart-review.googlesource.com/c/88804
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-09 16:04:12 +00:00
Danny Tuppeny 1d096d8499 Enable the analyzer Diagnostics server for LSP
Change-Id: I3a555c301e8c09b1d8af8f952f9f65102961d3b7
Reviewed-on: https://dart-review.googlesource.com/c/88801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-09 16:04:12 +00:00
Peter von der Ahé a1250467fe Move member conflict detection to own method
Change-Id: I73ea21e502b5669c51fb32d0c44474938135e4c5
Reviewed-on: https://dart-review.googlesource.com/c/88716
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-09 13:46:25 +00:00
Aske Simon Christensen 0f1b9439b5 Use 'no-' prefix to disable an experiment.
Change-Id: I597a98802f6900d57ed4583c35b20790738e2f3a
Reviewed-on: https://dart-review.googlesource.com/c/88712
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-01-09 11:44:48 +00:00
Peter von der Ahé de85d1661a Implement DillClass.supertype
Change-Id: I58c048a6595a2b65a7f2c239ae2bc1e6d8aab2a4
Reviewed-on: https://dart-review.googlesource.com/c/88715
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-09 11:33:16 +00:00
Johnni Winther 2bc015b03a Remove dependency on TypeEnvironment.hierarchy
Change-Id: Ibc675aa37bf1d5f90640b41471d094025ae3da86
Reviewed-on: https://dart-review.googlesource.com/c/88805
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-09 11:21:36 +00:00
Peter von der Ahé 7ba199794d Save transient state
Change-Id: I1c2405b1237b6017a92b789452671938e0c25705
Reviewed-on: https://dart-review.googlesource.com/c/88448
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-09 10:48:06 +00:00
Peter von der Ahé 2bb2f5e834 Simplify ClassHierarchyBuilder.getNode
Change-Id: I2ca5197f6f69cf92641493ec865ccfe0bc716a15
Reviewed-on: https://dart-review.googlesource.com/c/88324
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-09 10:48:06 +00:00
Peter von der Ahé 34afa499a1 Merge interfaces only when necessary
Change-Id: I3d6f709df3e262447150abd84c30ef5a58a7a1d8
Reviewed-on: https://dart-review.googlesource.com/c/88323
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-09 10:48:06 +00:00
Peter von der Ahé 1dc920e0d7 Change names to reflect merge isn't used only for superclasses
Change-Id: I06a6fb3272e394ba2c7915f457c4c3ebf7d21d07
Reviewed-on: https://dart-review.googlesource.com/c/87966
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-09 10:48:06 +00:00
Peter von der Ahé 50ea6344f5 Use TypeEnvironment.getTypeAsInstanceOf instead of ClassHierarchy
Change-Id: I1682baeb336b8be3cb6c5874715ef8ba730561e0
Reviewed-on: https://dart-review.googlesource.com/c/88803
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-09 10:08:03 +00:00
Kevin Millikin a7b23e1cb5 [Kernel] Add text serializers for some invocations
Add serializers for instance getters, setters, and methods and for
super getters, setters, and methods.  This requires also serializing
Arguments.

Change-Id: I36d36892bf896cd12b48f9e77395c0584daf47f1
Reviewed-on: https://dart-review.googlesource.com/c/88710
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2019-01-09 09:43:31 +00:00
Peter von der Ahé e7c808f910 Remove unused methods
Change-Id: I782700f972b846ec0d86b671c0c9b097ca73495d
Reviewed-on: https://dart-review.googlesource.com/c/88800
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-09 09:40:51 +00:00
Johnni Winther cc4da96fb5 Decouple runtime type analysis from the K-world
Change-Id: I56730796de4117b6500e22b86cf3c5d6b047646c
Reviewed-on: https://dart-review.googlesource.com/c/88714
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-01-09 08:57:16 +00:00
Konstantin Shcheglov d09c1265e9 Issue 35467. Move ast_type_matchers/element_type_matchers into test/util/.
R=brianwilkerson@google.com, paulberry@google.com

Fixes https://github.com/dart-lang/sdk/issues/35467
Change-Id: I2aab476e2e88f5bdbf5e62a2104ff7d271a73209
Reviewed-on: https://dart-review.googlesource.com/c/88780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-09 04:46:39 +00:00
Konstantin Shcheglov 6680438415 Parse AnalysisOptionsImpl.enabledExperiments into experimentStatus.
So, we don't need to parse everywhere we need to check the status.

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

Change-Id: I4c120d0d8baf46fc9cd981c6a1f10ffe27a2f2de
Reviewed-on: https://dart-review.googlesource.com/c/88753
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-09 04:46:19 +00:00
Mike Fairhurst 5f59e42f9c Remove unused import
Change-Id: I446ffc1a7b4575f266274acffea75c88e2128d68
Reviewed-on: https://dart-review.googlesource.com/c/88751
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-01-09 01:45:40 +00:00
Stephen Adams ea6d343bae js_runtime: Improve hashCode for double values
Change-Id: Ibe97c130eb6658fadec1010dd9ff3292488ffc1d
Reviewed-on: https://dart-review.googlesource.com/c/88760
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-01-09 00:45:50 +00:00
lambdabaa b767744cfc Add optional elementUri field to CompletionSuggestion types in analysis server protocol
This will enable clients such as IntelliJ to display the package which code
completions are being offered from in addition to the keyword or identifier
that they're already getting from analysis server.

R=brianwilkerson@google.com

Change-Id: I30311451ad56b4eddbe73da20641ee0d14849293
Reviewed-on: https://dart-review.googlesource.com/c/88744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-01-09 00:13:39 +00:00
Konstantin Shcheglov 303b3a96a7 Use ExperimentStatus field in summary / resynthesize tests.
Also, use _parseText() that calls Parser directly, without PARSED_UNIT
from tasks.

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

Change-Id: I75e4ac5cfaafd7072b3c656310eafec2b3bef2de
Reviewed-on: https://dart-review.googlesource.com/c/88743
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-08 21:23:56 +00:00
Konstantin Shcheglov 52a159de5c Change AnalysisContext.analysisOptions setter to just remembering the AnalysisOptions object.
There was a bug with not copying enabledExperiments.

We don't do such defensive copying for other objects.

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

Change-Id: I4508b8101d9a912e1645932a3f9c1855f71969c4
Reviewed-on: https://dart-review.googlesource.com/c/88740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-08 21:22:12 +00:00
Brian Wilkerson e9eb4842ea Remove the unused hint code INVALID_ASSIGNMENT
Change-Id: I4b3aff6b53dcfb5d5f00c49992050e08e5b52002
Reviewed-on: https://dart-review.googlesource.com/c/88641
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-08 19:15:47 +00:00
Jenny Messerly 253b0cc1e3 [dartdevc] improve cast failoure error message
The new message should be a bit more understandable. Inspired by the
suggestion in #35480.

Change-Id: I1e20adf5a13191705b28121dbeaf323682e6d324
Reviewed-on: https://dart-review.googlesource.com/c/88300
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-01-08 18:46:16 +00:00
Brian Wilkerson 2ca417aff1 Initial support for recording nullability in types
Change-Id: I1938517ab88e9c868a04d0490f4a336bd1a126e4
Reviewed-on: https://dart-review.googlesource.com/c/88433
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-08 17:53:16 +00:00
Danny Tuppeny f54ac41ce1 Ensure LSP server advertises it has QuickFixes
Also ensure we only return a bool for code action capabilities if the client doesn't support code action literals.

Change-Id: I277fc406ecdee6b0ee1c284f283cd3cb64fb5bdb
Reviewed-on: https://dart-review.googlesource.com/c/88721
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-08 17:22:21 +00:00
Sam Rawlins 9dbb6fb113 Add a Hint enforcing contract of @literal
Example code:

```dart
import 'package:meta/meta.dart';

class A {
  @literal
  const A();

  @literal
  const A.named();
}

var a = A();
var b = const A();
const c = A();
var d = new A();

var e = new A.named();
```

Produces:

Analyzing b.dart...
  hint • This instance creation must be 'const', because the A constructor is marked as '@literal' at b.dart:11:9 • non_const_call_to_literal_constructor
  hint • This instance creation must be 'const', because the A constructor is marked as '@literal' at b.dart:14:9 • non_const_call_to_literal_constructor
  hint • This instance creation must be 'const', because the A.named constructor is marked as '@literal' at b.dart:16:9 • non_const_call_to_literal_constructor
3 hints found.

Bug: https://github.com/dart-lang/sdk/issues/34259
Change-Id: Iba10e5e0a0b2d0f7e99556cd6c201cea229ad675
Reviewed-on: https://dart-review.googlesource.com/c/88422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-01-08 17:20:05 +00:00
danrubel 2cb346bd0c Add support for parsing complex nullable types
Change-Id: I38a59f96e299387b7266e46082d876105eb60f1e
Reviewed-on: https://dart-review.googlesource.com/c/88640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-08 15:52:54 +00:00
Danny Tuppeny 1ec1a8b46e Update LSP status doc
Change-Id: I8143fb3adae5917cda8ed03088c1187f487c15a7
Reviewed-on: https://dart-review.googlesource.com/c/88720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-08 15:26:05 +00:00
Kevin Moore 16f7f421df pkg:kernel - Fix three bugs identified by lints
Change-Id: I753153a9c8f5adeb9be516f60590bd3f33bc4923
Reviewed-on: https://dart-review.googlesource.com/c/88680
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2019-01-08 14:54:05 +00:00
Kevin Moore 6f3ce5b9e9 Fixes for SDK packages
Change-Id: I544e4e085cc1e420397d6d825a93376ae586f9a4
Reviewed-on: https://dart-review.googlesource.com/c/88681
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 14:53:42 +00:00
Jens Johansen ac99b68c00 Don't catch call to buildOutlines
This was meant to be a bandage until a real fix landed
(which it did a few days after the 'fix' landed).
While it might still 'fix' something, it also does so silently meaning
that we won't ever catch it if we keep this try block.

Change-Id: I12b69ca06accd0b3fd3c51e2c292e61157c40f71
Reviewed-on: https://dart-review.googlesource.com/c/88571
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-08 13:19:15 +00:00
Jens Johansen 199fdb4d9e Dill loader.builders shouldn't have dart: uris removed
Change-Id: I96b2d995058a014af8d23addd66a893b9b740fe6
Reviewed-on: https://dart-review.googlesource.com/c/88569
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-08 13:15:14 +00:00
Kevin Millikin 8e486164a4 [Fasta] Enable running the constant evaluation pass
The experimental flag `constant-update-2018` selects front-end
constant evaluation.  The transformation is run before performing any
backend-specific transformations.

Compiling dart2js in strong mode goes from 12 seconds to between 12.3
and 12.5 (with more variability, apparently).

Change-Id: I279f0e60a3197b4fb077a1e9641ea92cf1409612
Reviewed-on: https://dart-review.googlesource.com/c/88701
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-08 12:19:53 +00:00
Peter von der Ahé 938665a290 Update comment to match parameter
Change-Id: I7d63ae36110d9baf2b00c713490e07962bd069b0
Reviewed-on: https://dart-review.googlesource.com/c/88706
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-08 11:32:13 +00:00
Dmitry Stefantsov 113ca50ba3 [kernel] Add a step to fasta unit tests to check text serialization
Change-Id: I8d945fc9d75aad1c4275b6d3dd3f9e2ea884ea9f
Reviewed-on: https://dart-review.googlesource.com/c/88451
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-08 10:31:42 +00:00
Dmitry Stefantsov 6b8826f336 [kernel] Rename failure classes for TextSerializationVerifier
Change-Id: I51240e069a1a518fe35d25d2a44e8d7a84343946
Reviewed-on: https://dart-review.googlesource.com/c/88562
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:31:42 +00:00
Dmitry Stefantsov c76c5a023d [kernel] Rename 'errors' to 'failures' in TextSerializationVerifier
Change-Id: I9886e1c7ba4fbacff18f79a627f8e75b50c960c7
Reviewed-on: https://dart-review.googlesource.com/c/88561
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:31:42 +00:00
Dmitry Stefantsov cebd469ecd [kernel] Move RoundTripVerifier to pkg/kernel/lib/text and rename it
Change-Id: Icb61feab76be161e99b8c2fd316e41271470182a
Reviewed-on: https://dart-review.googlesource.com/c/88560
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:31:42 +00:00
Kevin Millikin a2844bdfd4 [Kernel] Add serializers for public names
This will enable serialization of expressions blocked on names.
Supporting private names requires a map from from serialized library
ID to library.  More generally, we need to support something like the
dill file's canonical names.

Change-Id: I7d470e6a49b167f7755d130ea6c3e543e188da65
Reviewed-on: https://dart-review.googlesource.com/c/88703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:28:42 +00:00
Johnni Winther fef600a998 Remove effectively empty type holders
+ correctly join with path with less information.

Change-Id: I44921f5b1d1613934d5321d87840db689b3b4b0b
Reviewed-on: https://dart-review.googlesource.com/c/88573
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-08 09:19:29 +00:00
Samir Jindel b58e8d7307 [vm] Use TFA to remove explicit type-checks (including keyword-covariant parameters).
- Also allow using the unchecked entry-point for invocations of generic functions where
  there are no bounds or the bounds don't require dynamic checks.

Change-Id: I6ca1ebec777ecf2989c4fb77425d65d542d5adf2
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/87181
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-08 08:36:58 +00:00
Max Bittker 2c09a4cf33 update error message
fixes a small typo in the `INVOCATION_OF_NON_FUNCTION_EXPRESSION` message

Closes #35589
https://github.com/dart-lang/sdk/pull/35589

GitOrigin-RevId: b30d58449c7d2d7a786d71f64ce1a4251de72296
Change-Id: I623ebd0f5113e4bc8b1e07bfd963c27a28c7fef0
Reviewed-on: https://dart-review.googlesource.com/c/88603
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-07 23:38:43 +00:00
Konstantin Shcheglov 3cec3dd5bf Issue 35548. Don't report CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD when mixin has a static field.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/35548
Change-Id: I46a2006574e31505a860a9e54640b643bb514ae7
Reviewed-on: https://dart-review.googlesource.com/c/88600
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-07 22:32:53 +00:00
Konstantin Shcheglov f715a2e79e Include experiments into AnalysisOptions.unlinkedSignature.
Enabled experiments might affect how we parse Dart code, e.g. `?` for
nullable types. So, we need to include at least some experiments into
unlinkedSignature. So, we pessimistically include all of them.

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

Change-Id: Ib6e95fe7f4efaa6e6ada1c3a81d010c89f9676d5
Reviewed-on: https://dart-review.googlesource.com/c/88602
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-07 22:16:03 +00:00
Jenny Messerly e541849a9f [dartdevc] fix mixin super constructor calls in kernel backend
Kernel and Analyzer have slightly different rules for creating implicit
constructors, which DDC's kernel backend did not account for. This
resulted in a mismatch between which super constructor calls it thought
were necessary, vs which constructors were generated.

Both DDC backends are now less sensitive to the representations, and
the kernel backend checks for field initializers in mixin declarations,
rather than relying on the (nonexistent) implicit constructor node.

Change-Id: I01a6ae11ecf78193d7db227ba0b7adeb27d514d5
Reviewed-on: https://dart-review.googlesource.com/c/88432
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-01-07 21:14:22 +00:00
Konstantin Shcheglov eebafbc4a8 Issue 35090. Add noSuchMethod forwarders to implemented members.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/35090
Change-Id: I1a72d70effe49111921a0db2a2e5396197d3a51b
Reviewed-on: https://dart-review.googlesource.com/c/88542
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-07 19:40:19 +00:00
Konstantin Shcheglov b2ace8fa61 Add hasPragmaAnalyzerNonNullable to AstBuilder and CompilationUnitImpl.
Start integration testing for non-nullable types.

Just interface type, and just parsing for now. Obviously we cannot
start working on resolver until the CL with `nullability` is landed.

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

Change-Id: I8fe70c29b25fad56739a549b09a235a83f9960e7
Reviewed-on: https://dart-review.googlesource.com/c/88434
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-07 19:39:28 +00:00
lambdabaa 5f25d1546c Guard analysis server against missing .instrumentation directory location on disk
Currently if analysis server fails to resolve this directory, it will
crash the entire process with

NoSuchMethodError: The method 'getChild' was called on null.

_readUuid() was already failing over to generating a new random
identifier if it was either unable to find a uuid.txt file or
create one, so this change just triggers that behavior additionally
in the case that the parent directory is missing.

R=brianwilkerson@google.com

Change-Id: Ieafde2df5afd7e30a3830f241af02bf305c911ec
Reviewed-on: https://dart-review.googlesource.com/c/88428
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-01-07 17:31:06 +00:00
Johnni Winther e14472c46b Use getters/setters found through the static types.
This uses the information from the static types now used in inference which
can improve the precision in particular for generic classes. Since type
masks lose the type argument information, we cannot expect locating members
based on the type mask to be more precise than what has been found through
the static types.

This CL also expands the unit test framework to support unit test of
optimizations and the emission model, including tests of the improved
field access handling.

Closes #35433

Change-Id: Ia5de15efaf8b60c8723943bb34de6eec7d380798
Reviewed-on: https://dart-review.googlesource.com/c/88440
Reviewed-by: Stephen Adams <sra@google.com>
2019-01-07 15:01:10 +00:00
Brian Wilkerson 555485c891 Start splitting out the tests for hint codes
Change-Id: I2d221aa024b6db9426d7adf6b38c17da0be599d9
Reviewed-on: https://dart-review.googlesource.com/c/88541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-07 14:25:20 +00:00
Peter von der Ahé dd47792f16 Replace isMergingInterfaces with an enum
Change-Id: I4af320373b38d301943e12e2e9916b5eccdd2f31
Reviewed-on: https://dart-review.googlesource.com/c/87964
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-07 13:50:16 +00:00
Peter von der Ahé f3677bb2e7 Merge interfaces when building hierarchy
Change-Id: I2d3db2fa653a4caa9f90bdc8557d80f5a2836a52
Reviewed-on: https://dart-review.googlesource.com/c/87641
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-07 13:50:16 +00:00
Peter von der Ahé 0008641bfd Remove InterfaceResolver.legacyMode
Change-Id: Icc4d51dd4d2ff35d2048f8190ca134919c56f6a0
Reviewed-on: https://dart-review.googlesource.com/c/87588
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-07 12:41:12 +00:00
Jonas Termansen 7d6a3e0058 Fix http links to pub which has https.
Change-Id: I3b712014fb0744b890df426e941907760bd92780
Reviewed-on: https://dart-review.googlesource.com/c/88452
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2019-01-07 11:37:19 +00:00
Alexander Markov 3b29f5ad81 [VM/AOT/TFA] Do not attribute calls via fields/getters with inference results
MethodInvocation nodes which have field or getter as interface target
actually correspond to 2 calls: 1) getter; 2) implicit call() on the result
of the getter.

While this was correctly modeled in summaries in TFA, it is not correct
to attribute such MethodInvocation nodes with results of the inference,
as results correspond to an each distinct call. To fix this, Call
statements in summaries are created without attaching them to a
corresponding kernel AST node.

Change-Id: I3ea28ed85550192f8b592a926cac0eae23810811
Reviewed-on: https://dart-review.googlesource.com/c/88424
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-07 10:22:40 +00:00
Brian Wilkerson a10f6aac38 Finish cleaning up the copyright notices in the analyzer_cli package
Change-Id: I4de3c9e17b4e569c32470ffd1c2061749d3184ed
Reviewed-on: https://dart-review.googlesource.com/c/88439
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-06 19:16:31 +00:00
Konstantin Shcheglov f259cc674f Don't split const/final variable declarations. Add explicit type.
R=brianwilkerson@google.com, keertip@google.com

Change-Id: I418a5e541194f2c94927f23b3468a6a876e05a1b
Reviewed-on: https://dart-review.googlesource.com/c/88438
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-06 18:53:29 +00:00
Brian Wilkerson 4e0762c636 Fix constant evaluation for the new bool operators
Change-Id: I4a30544b2d0e5cff8287dbe5fc83387b4e92a875
Reviewed-on: https://dart-review.googlesource.com/c/88437
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-01-05 22:57:19 +00:00
Brian Wilkerson cb61275708 Remove remaining uses of Null as a type argument from analyzer
Change-Id: I6022fbc18c002447278ec8dc0e2b24d3eb369a49
Reviewed-on: https://dart-review.googlesource.com/c/88436
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-05 19:26:07 +00:00
Brian Wilkerson 18844b85ec Remove occurrences of Future<Null> from analyzer_cli
Change-Id: I008589455681dd5da80df4e466803f8cf48cd910
Reviewed-on: https://dart-review.googlesource.com/c/88435
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-05 19:25:47 +00:00
Brian Wilkerson 2f913e7c15 Add documentation about how to debug plugins
Change-Id: Ie0e90e1412b88c357d5774cd07f6f08bfad9c579
Reviewed-on: https://dart-review.googlesource.com/c/88421
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-05 16:01:03 +00:00
Brian Wilkerson c39a58a9fe Generate an error if a constant set contains two elements with the same value
Change-Id: Ie359a1ea639e9c928df32c727bcd2f075f92033f
Reviewed-on: https://dart-review.googlesource.com/c/88425
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-01-05 15:13:12 +00:00
Mike Fairhurst 88b1a9d241 Remove hack; test fix for #35441
Change-Id: I9505598e904e4ee39b00cbae87082f5f332f3505
Reviewed-on: https://dart-review.googlesource.com/c/87612
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-05 03:52:34 +00:00
Konstantin Shcheglov 614f6241bb Initial version of DefiniteAssignmentTracker.
I think it supports all expressions and statements.

Change-Id: I753bd6ce781f54c1dfd0f15f69fca2f15c2a1877
Reviewed-on: https://dart-review.googlesource.com/c/87423
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-04 23:54:23 +00:00
Jenny Messerly 36ab8b18ea [dartdevc] implement set literal and enable-experiments support
Change-Id: Ibc45b1b1792d62a8f176e6c2f2f5c1e3134942f1
Reviewed-on: https://dart-review.googlesource.com/c/88400
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-01-04 22:08:54 +00:00
danrubel 26d5345fb1 Fix TypeInfo.couldBeExpression in recovery situations
Change-Id: Ia9f1735b8ad28dbfcde1f54ac70628e85b65c1d3
Reviewed-on: https://dart-review.googlesource.com/c/88480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-04 21:08:35 +00:00
Brian Wilkerson 80fa1a874d Replace more uses of deprecated elements
Change-Id: Ied014ca1d8cbf5917b5e3d15d0892e2e02257ccf
Reviewed-on: https://dart-review.googlesource.com/c/88423
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-04 18:35:53 +00:00
Jenny Messerly 3d6acab3e7 [dartdevc] remove unused dartdevk binary, fixes #35483
It's simply an alias for `dartdevc --kernel`, and now that build_runner
is switching to that, there's no reason to keep it around anymore.

Change-Id: I43d30a582314a236bcfa2e3a0b50bb48ddac79f8
Reviewed-on: https://dart-review.googlesource.com/c/88281
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-01-04 17:19:52 +00:00
Dmitry Stefantsov 7778a8b6ca [kernel] Start setting up test suite for round-trip serialization
Change-Id: I00920c41a5eaa99a7cc3eececff1caac94b1c1c9
Reviewed-on: https://dart-review.googlesource.com/c/88184
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 5e609d7946 [kernel] Implement serialization round-trip check for dart types
Change-Id: Ie97439e6f822eb1e94c17cc4a5f3c04f1f58a4bc
Reviewed-on: https://dart-review.googlesource.com/c/88444
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 39539773bb [kernel] Implement serialization round-trip check for expressions
Change-Id: Ibf3766f5325a9bf0b1016232319e0b308eca188c
Reviewed-on: https://dart-review.googlesource.com/c/88442
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 3b728c0a04 [kernel] Wire round-trip verification down to expressions and types
Change-Id: Iab7a41fced28c58ea1280b5a8960d3440bc29e23
Reviewed-on: https://dart-review.googlesource.com/c/88441
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 1cbae9fe48 [kernel] Start implementing verifier for serialization round trips
Change-Id: I907e92cf7b7f791a4bc64cac6739489d38d2c224
Reviewed-on: https://dart-review.googlesource.com/c/88322
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00