Commit Graph

25510 Commits

Author SHA1 Message Date
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