Commit graph

22084 commits

Author SHA1 Message Date
Peter von der Ahé 6b547e2683 Convert analyzer to use onDiagnostics
Change-Id: I224894b47a03c8b5cf48ddd3a125ba09a9a47a23
Reviewed-on: https://dart-review.googlesource.com/c/77842
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-10-04 07:29:34 +00:00
asiva 218d30e26a Skip source files attributed to 'dart:' libraries when writing a dep file.
Change-Id: I656edd730c1bb2433768646295cf3ab4325819c1
Reviewed-on: https://dart-review.googlesource.com/c/77985
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-10-04 00:23:11 +00:00
Janice Collins 644342a6e6 Prepare for analyzer 0.33.0 publish.
Change-Id: Idaf40321b8ba861670f5492bec7697865726b428
Reviewed-on: https://dart-review.googlesource.com/c/77982
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 22:36:17 +00:00
Konstantin Shcheglov 1085dd13d1 Use separate 'type index' for mixin, some nodes might be unresolved.
R=brianwilkerson@google.com

Change-Id: Idf4bde1e4927bd0f1b69d6e0acef2cb97ade0bf9
Reviewed-on: https://dart-review.googlesource.com/c/77940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-03 20:26:13 +00:00
Danny Tuppeny 878779e1a2 Fix test and add TODO for others that need updating
Change-Id: I381f442ec7ac5f5c69901c70e6a33dfd196d56b4
Reviewed-on: https://dart-review.googlesource.com/c/77884
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-03 19:44:40 +00:00
Konstantin Shcheglov 3daa63bc4c Revert OverrideVerifier back to the old InheritanceManager.
This partially reverts https://dart-review.googlesource.com/c/sdk/+/77521

There is still one pre-existing issue, will be fixed later.

R=brianwilkerson@google.com

Change-Id: Ide556a65ef2e46f1621ac60b1b7a32207d804b31
Reviewed-on: https://dart-review.googlesource.com/c/77920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-03 19:23:05 +00:00
Samir Jindel aa25872027 [vm] Fix pkg/vm/tool/precompiler2.
Change-Id: Ic361d24625125e30c6e7cff90ed7dc00f845d18f
Reviewed-on: https://dart-review.googlesource.com/77882
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2018-10-03 18:39:17 +00:00
danrubel ab3ef0914c Allow "yield" as label
Fix https://github.com/dart-lang/sdk/issues/33672

Change-Id: I1d070fd2fd3901d8159aa760b094398efee8643c
Reviewed-on: https://dart-review.googlesource.com/77501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-03 18:32:07 +00:00
danrubel f529ab10f0 Allow "operator" as a static method name
Fix https://github.com/dart-lang/sdk/issues/33673

Change-Id: Ia2ec01a3b9cf701f7f85f4891d2fb45f1f01e444
Reviewed-on: https://dart-review.googlesource.com/77500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 18:32:07 +00:00
Paul Berry 57f8542ea5 Fix warnings in analyzer package.
Change-Id: Id2db43c7e7822a912879c742629eeefcdeedd9a9
Reviewed-on: https://dart-review.googlesource.com/77724
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 17:53:57 +00:00
Alexander Markov 270fd8e4a8 [vm/aot] Handle annotations on parameters in tree shaker and constant evaluator
Fixes https://github.com/dart-lang/sdk/issues/34644
Issue https://github.com/flutter/flutter/issues/22355

Change-Id: Iaf1e5da9a2d33cf4cd8ea2510cf1faff1a20c886
Reviewed-on: https://dart-review.googlesource.com/c/77673
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-03 16:16:46 +00:00
Alexander Markov 6d0601a72b [vm/bytecode] Add bytecodes for int operations and '== null'
DeltaBlue performance in pure interpreted mode
(--enable-interpreter --compilation-counter-threshold=-1):
Before: DeltaBlue(RunTime): 269198.732 us.
After:  DeltaBlue(RunTime): 158216.34376923076 us. (-41.23%)

Change-Id: I9dea8d7949421986ee6fbdeae046fe4ef6d3227f
Reviewed-on: https://dart-review.googlesource.com/c/77231
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-10-03 15:45:36 +00:00
Aske Simon Christensen eacf720d2b Functions to demangle mixin application class names
Demangle all names in messages to avoid printing mangled names in
user-facing output.

Point messages about implicit mixin application classes at the subclass
name for consistency with named mixin application classes.

Change-Id: I90973986c422f271af99e18b3deb5847adf4d430
Reviewed-on: https://dart-review.googlesource.com/c/77380
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-03 14:56:43 +00:00
Aske Simon Christensen bb2775b16a Only perform override check on declared members.
The code in class_hierarchy.dart that looped over override pairs
included implementations inherited from its superclass as potential
overriders, presumably in a broken attempt to include some interface
checks into the mix.

With this problem fixed, the special case in kernel_class_builder.dart
that excluded overriders not declared in the current class (i.e.
declared in a mixin) could be removed without incurring false
positives.

These override checks performed on members from a mixin produce an
extra context message indicating the class where the two members meet,
giving rise to the override relation (similarly to interface checks).

Since the same member can now override more than one member (or even
the same member more than once), the diagnostics message duplication
check has been extended to also include the context in the comparison.

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

Change-Id: I990e5719ae1749fd1aad1ad478aaa6e173cb170b
Reviewed-on: https://dart-review.googlesource.com/c/76900
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-10-03 14:56:43 +00:00
Aske Simon Christensen d3bd06d4e8 Check class interface requirements using override check code.
When a member in the interface of a non-abstract class is found to
have an implementation with the correct name which does not override
the representative declaration of the member in the interface (and thus
has not been checked against that member for override validity), call
the override check to check interface validity.

Override relations thus checked produce an extra context message
explaining that the override relation must hold because both members
are inherited by a non-abstract class.

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

Change-Id: I955f057e35fa30f33c19da37c9cea1262042431c
Reviewed-on: https://dart-review.googlesource.com/c/74642
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-03 14:56:43 +00:00
Danny Tuppeny 2dfe46fba2 Additional work on MOVE_FILE and associated tests
- Update outgoing part-of relative uris (may need changing)
- Add a helper for verifying failed refactor statuses
- Use the original file location for checking if in an analysis root
- Remove tests for functionality we're not yet supporting
- Remove forced failures and @failingTest for tests that work

Bug: https://github.com/dart-lang/sdk/issues/33605
Change-Id: I405bfcb92ce2ce66710caf934fc03e10eb66aea3
Reviewed-on: https://dart-review.googlesource.com/c/77541
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 14:22:11 +00:00
Paul Berry c57a844841 Characterize behavior of FunctionTypeImpl.forTypedef when typeArguments not provided.
I believe that in order to fix #34558 I will need to modify how
function types are built for typedefs.  Before doing so, I want to
make sure I fully understand the (flawed) behavior of
FunctionTypeImpl.forTypedef.

See #34657 for more details about how the behavior of forTypedef is
flawed (and how I believe it ought to behave).

Change-Id: I15e981175da46e444425984a70cfda54e9e3749b
Reviewed-on: https://dart-review.googlesource.com/c/77721
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 14:07:37 +00:00
Peter von der Ahé ed42aab273 Move source.dart to package:analyzer
Change-Id: Ide66d4f69b8588f04967c510eae0a733b4b3f0c5
Reviewed-on: https://dart-review.googlesource.com/c/77860
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 12:56:49 +00:00
Peter von der Ahé 82da68f3f5 Move api_signature to package:analyzer
Change-Id: I5dd66495316bc4b894d0fad791b77a882bb07ade
Reviewed-on: https://dart-review.googlesource.com/c/77822
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 12:56:49 +00:00
Peter von der Ahé 829ba8a118 Remove unused file_repository.dart
Change-Id: I87bb89eb4bce69843e5219b410927e45da73230f
Reviewed-on: https://dart-review.googlesource.com/c/77840
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 12:53:54 +00:00
Peter von der Ahé b8cef2cefe Move flat_buffers to package:analyzer
Change-Id: Ie9e6c8d3c56a17e689f23434a3045c23de59eeee
Reviewed-on: https://dart-review.googlesource.com/c/77821
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 12:48:44 +00:00
Peter von der Ahé 27b17c76d8 Remove unused uri_resolver.dart
Change-Id: Ica49f8446bc57dc9d7bd4d8460231dc9272542c6
Reviewed-on: https://dart-review.googlesource.com/c/77820
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 12:48:44 +00:00
Peter von der Ahé 29d57107dd Move dependency_walker to package:analyzer
Change-Id: I9882c2be31366cc85a1623a2b324ce4ec200aa20
Reviewed-on: https://dart-review.googlesource.com/c/77804
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 12:25:06 +00:00
Peter von der Ahé 440b9c61a7 Handle duplicated declaration used as prefix.
Fixes https://github.com/dart-lang/sdk/issues/34645

Change-Id: I24842b6146c1e3b38ae0b6561ae0e1bec63db2a9
Reviewed-on: https://dart-review.googlesource.com/c/77802
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-03 09:57:14 +00:00
Peter von der Ahé eb0ec965e3 Move codegen/tools.dart to package:analyzer
Change-Id: Iab61e0dfcdd0969d1bf35e27c13c336a944d14e6
Reviewed-on: https://dart-review.googlesource.com/c/77780
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 07:41:43 +00:00
Peter von der Ahé fd9a2cb510 Remove unused stuff
Change-Id: Id3372bc0d64711438dee3eb5503ee6c809b3d40c
Reviewed-on: https://dart-review.googlesource.com/c/77740
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-03 06:59:25 +00:00
Peter von der Ahé bc49637085 Convert package:dev_compiler to use onDiagnostic
Change-Id: I67eaae26c40452dd94c4135e813cfdd89e2fb087
Reviewed-on: https://dart-review.googlesource.com/c/77563
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 06:46:55 +00:00
Peter von der Ahé 44c6312df8 Consolidate VM dependencies on front_end
Also, convert package:vm to use onDiagnostic.

We're consolidating all dependencies on package:front_end in one file per tool.

The idea is, if you want to depend on something in the package:front_end, you modify pkg/front_end/lib/src/api_unstable/vm.dart and consult with the front-end team.

These consolidated files will help us when designing a public API in the future.

Change-Id: I66bafdd0ae29605fd12f8d6c589dbc761e5c7a97
Reviewed-on: https://dart-review.googlesource.com/c/77581
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 05:41:30 +00:00
Konstantin Shcheglov b628a62aa8 Remove ConstantValueComputer and DirectedGraph.
We use different graph implementation in Analyzer, CFE has its own.
And ConstantValueComputer is not used in Analyzer or anywhere internally.

R=brianwilkerson@google.com

Change-Id: I1abaca5205fa0af7c50675d2935b0d6f21373b31
Reviewed-on: https://dart-review.googlesource.com/c/77672
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-03 01:51:03 +00:00
Brian Wilkerson bd7b776bb4 Fix more quick fix tests
Change-Id: I07c9900be8dc3510d729f77b98c95acd06159043
Reviewed-on: https://dart-review.googlesource.com/c/77671
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 00:16:15 +00:00
Paul Berry 621c41f091 Add mixin support to InterfaceTypeImpl.isMoreSpecificThan.
In the long run we should eliminate the code duplication between
InterfaceTypeImpl.isMoreSpecificThan and TypeSystem.isMoreSpecificThan
(see #34653), but this gets us past the immediate bug.

Fixes #34641.

Change-Id: I0a7935cff7a0d73728a918db7513e46ff73bc984
Reviewed-on: https://dart-review.googlesource.com/c/77676
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 00:01:16 +00:00
asiva 30aa464f77 [VM] Remove 'corelib' and 'dart-io' sources generation into C++ arrays
- Remove all code that generates the corelib and dart:io library sources into C++ arrays and link them into dart_bootstrap
- Remove the executable dart_bootstrap and all uses of it
- Remove bootstrap_nolib.cc and builtin_nocore.cc
- Remove the Dart 1 code in core lib bootstrap path

Change-Id: Ifd33496204285a08b42fe09e39428e7a92b416b6
Reviewed-on: https://dart-review.googlesource.com/c/77241
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-10-02 23:27:05 +00:00
Konstantin Shcheglov 80db08809c Pass InheritanceManager2 into resolver, use for BinaryExpression.
Ideally I think we should not use Expression.staticParameterElement to
get back to the corresponding parameter of the invoked FunctionType,
and do this check directly during resolution.

R=brianwilkerson@google.com

Change-Id: I6dbb5bf63f7eaad7f19b31129319e32dd4455acc
Reviewed-on: https://dart-review.googlesource.com/c/77641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 21:48:36 +00:00
Konstantin Shcheglov 3ef994c287 Some clean ups in InheritanceOverrideVerifier.
R=brianwilkerson@google.com

Change-Id: I326556fb2d7b16fa05daa872a04bdf413bcfce18
Reviewed-on: https://dart-review.googlesource.com/c/77670
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-02 21:31:40 +00:00
Brian Wilkerson edd86ef7a1 Generate quick fix for await in non-async (issue 34647)
Change-Id: Iabf8f11c8c477d1642e5122a5748b04bcdc5efa3
Reviewed-on: https://dart-review.googlesource.com/c/77669
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 20:46:36 +00:00
Konstantin Shcheglov 4df3626d19 Remove support for (non)nullable types from Analyzer.
R=brianwilkerson@google.com

Change-Id: Ia26c203ed4fa238d1a546fe67e009fa542ed8f82
Reviewed-on: https://dart-review.googlesource.com/77666
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 20:05:15 +00:00
Brian Wilkerson d2c5a24fd9 Recognize mixins as subtypes of their superclass constraints in hint generation (issue 34633)
Change-Id: I84b86e998ec353c13b18a460f2a7ca8cb0802204
Reviewed-on: https://dart-review.googlesource.com/77665
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 19:20:35 +00:00
Brian Wilkerson 72d3798764 Improved completion support for mixins
Change-Id: I77aea1b03e00725c48458b0e6ee9b1936ea5685c
Reviewed-on: https://dart-review.googlesource.com/c/77661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 18:27:33 +00:00
Peter von der Ahé 097e8d86b8 Use context severity when calling onProblem
Change-Id: Id1aef8c9185e4d1e660cc342d54a12923a890a43
Reviewed-on: https://dart-review.googlesource.com/77060
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 17:02:10 +00:00
Peter von der Ahé 002a3e090d Improve error message on unresolved constructor redirections
Change-Id: Ifd3975becaeeb312a5c3ca12228828ea49a00d2b
Reviewed-on: https://dart-review.googlesource.com/76942
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 17:02:10 +00:00
Brian Wilkerson a074a87b25 Convert more analyzer tests to use ResourceProviderMixin
Change-Id: I0b6d54501a7f52f0b8ae2faa72992cd22dfc6c58
Reviewed-on: https://dart-review.googlesource.com/77600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 16:57:43 +00:00
Peter von der Ahé a1ebe68359 Change how compile-time NSM is handled
Change-Id: I8dc408c1ffec9307e776288a8fb99604c7dedd6b
Reviewed-on: https://dart-review.googlesource.com/76664
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 16:53:03 +00:00
Konstantin Shcheglov b8c831592a Record superInterface and use it for OverrideVerifier.
R=brianwilkerson@google.com

Change-Id: Ib6fe2b14affc8f8d00c32f123a4b587ae6d8fb56
Reviewed-on: https://dart-review.googlesource.com/77521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-02 14:02:31 +00:00
Peter von der Ahé 158290349a Reject diagnostics with missing arguments
That is, arguments that are null or empty.

Change-Id: I9b580f44ed960f2a0270c91fd8c98b9b43c7ceed
Reviewed-on: https://dart-review.googlesource.com/76604
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 13:59:20 +00:00
Peter von der Ahé df32b2ae49 Ignore synthetic tokens when compiling bodies
Change-Id: Id5f6c4158e70f5a444a6baec1374da20f961a4ec
Reviewed-on: https://dart-review.googlesource.com/76603
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 13:59:20 +00:00
Peter von der Ahé f3047f1b9c Improve diagnostics with constructor names
Change-Id: I4065ca11064b7569c869f9ea665c85fd287432ce
Reviewed-on: https://dart-review.googlesource.com/76602
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 13:59:20 +00:00
Peter von der Ahé 1972ad92d7 Related information (context) may be null
Change-Id: Ic4cb0195722c5d5bbb83cd4463f12c0c32e0fc1a
Reviewed-on: https://dart-review.googlesource.com/77561
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-02 12:36:54 +00:00
Peter von der Ahé 248954117a Consolidate dart2js front-end dependencies
Also, convert dart2js to use onDiagnostic.

Change-Id: Ifdf89349eaf2ebe8cfcd1994712b3d1be2dd4197
Reviewed-on: https://dart-review.googlesource.com/77400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-10-02 12:34:28 +00:00
Peter von der Ahé 4306245660 Address review comments from 63144 and 74640
Change-Id: I886bdb75902689a9880f9bac78f3d5dd07839fc3
Reviewed-on: https://dart-review.googlesource.com/76943
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 08:03:43 +00:00
Konstantin Shcheglov 7ca2f56112 Stop using and deprecate InheritanceManager.getMembersInheritedFromInterfaces().
R=brianwilkerson@google.com

Change-Id: Ia24248cc0d80960d2a4aa40e0da519804c68abbc
Reviewed-on: https://dart-review.googlesource.com/77483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 22:40:07 +00:00
Konstantin Shcheglov f5135c6e86 Don't recurse into arguments of constant InstanceCreationExpression while verifying.
This reduces time required to verify constant errors on my Flutter
analysis benchmark from 1770 ms to 540 ms. Total analysis time is also
down the similar value.

R=brianwilkerson@google.com

Change-Id: Ia307b33ddd36f8f7e88c0f909422b980d3c67dda
Reviewed-on: https://dart-review.googlesource.com/77481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 20:45:10 +00:00
Paul Berry 32af1be0a4 Check type arguments against bounds when instantiating a typedef.
Change-Id: I38f390abd2c409694ad15cbc35654ba5dab9b9ce
Reviewed-on: https://dart-review.googlesource.com/77015
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 20:43:19 +00:00
Brian Wilkerson e90f1f21b8 Remove unused response codes and deprecate an unimplemented request
Change-Id: I7a07182ce8b7e7636f20bd4c661e94dd3dff985c
Reviewed-on: https://dart-review.googlesource.com/77480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 20:19:59 +00:00
Brian Wilkerson dd2e6afd5e Add test for InheritanceManager2
Change-Id: I49f0bddb27a18a1938b2778832be09d6c533c021
Reviewed-on: https://dart-review.googlesource.com/77462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 19:10:19 +00:00
Brian Wilkerson f7f31efab0 Disable the reading of a UUID during training
Change-Id: Idb4d1d2ea4c7a862ff3d54718d2bf924492f3779
Reviewed-on: https://dart-review.googlesource.com/77422
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 19:07:59 +00:00
Konstantin Shcheglov 64f02226b3 Stop using InheritanceManager.getMembersInheritedFromClasses().
R=brianwilkerson@google.com

Change-Id: I2f719f6c3c5383ac76608b9fd5b7251f3af0d6bb
Reviewed-on: https://dart-review.googlesource.com/77463
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 19:02:14 +00:00
Konstantin Shcheglov e4671346ac Fix build mode to convert input paths to absolute and normalized before giving them to Analyzer.
R=brianwilkerson@google.com

Change-Id: Ib317c13bb159c2de6f6b77500378ac002ebff746
Reviewed-on: https://dart-review.googlesource.com/77461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 18:18:02 +00:00
Konstantin Shcheglov 765a78d44e Fix AST summarizer rules when to store variable initializer.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/34619
Change-Id: Ic708c6e82aa19bcac4c92a7358e2f947b2299d5c
Reviewed-on: https://dart-review.googlesource.com/77260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-10-01 18:15:17 +00:00
Konstantin Shcheglov b6368c78fa Extract PhysicalResourceProvider watch tests and mark them flaky.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I3a203392acfb344dc5c88a815f6db15ccb3560f3
Reviewed-on: https://dart-review.googlesource.com/77460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 18:07:43 +00:00
Brian Wilkerson 2723fcfb82 Remove more dead code from server
Change-Id: Ib0af3295bc064fab0a271337a42f3925ccf205dc
Reviewed-on: https://dart-review.googlesource.com/77420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 15:43:12 +00:00
Brian Wilkerson ce8a5ffab2 Remove remaining definitions of EMPTY_LIST in server
Change-Id: Ia7a9286f2fc7e151f99091169635b71fde88649a
Reviewed-on: https://dart-review.googlesource.com/77421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 15:42:55 +00:00
Konstantin Shcheglov 9083b116f8 InheritanceManager does not produce errors, don't ask it.
R=brianwilkerson@google.com

Change-Id: I0b26de6d60b02574b5a13803491833d4aaf43a1d
Reviewed-on: https://dart-review.googlesource.com/77269
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 15:34:55 +00:00
Peter von der Ahé 645fbc8a3f Add CompilerOptions.onDiagnostic
Change-Id: I116eb4b3ce03ae50d8b314531e0b463d4fe58649
Reviewed-on: https://dart-review.googlesource.com/77362
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-10-01 13:28:46 +00:00
Konstantin Shcheglov 0461df2e22 Remove FileState.fileUri.
It was used for CFE integration, and we don't need it anymore.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34621
Change-Id: Ieb8dd121da4cb34cb16487c90dada54868c06e39
Reviewed-on: https://dart-review.googlesource.com/77268
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:34:53 +00:00
Brian Wilkerson 10f05f45b9 Remove more dead code from server
Change-Id: I09d7c2e96d41f095cb456a5eccb04eaa447430cd
Reviewed-on: https://dart-review.googlesource.com/77263
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 01:21:38 +00:00
Konstantin Shcheglov 5cc9ab02a8 Switch all refactoring to using ResolveResult instead of raw unit.
R=brianwilkerson@google.com

Change-Id: I3fa7c5c22966dd5d464e438e9300587d80c180b2
Reviewed-on: https://dart-review.googlesource.com/77267
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:17:58 +00:00
Konstantin Shcheglov 215e80eb0a Fix Analysis Server tests on Windows bot.
R=brianwilkerson@google.com

Change-Id: I0afc4ee40d8b1030bbcfc35bfb43a13d2db3accd
Reviewed-on: https://dart-review.googlesource.com/77266
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:09:28 +00:00
Konstantin Shcheglov 85fb1f3de1 Fix Analyzer tests on Windows bot.
R=brianwilkerson@google.com

Change-Id: Ia43513d068a7676e8760efb87631cccd124b3c69
Reviewed-on: https://dart-review.googlesource.com/77265
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:02:46 +00:00
Konstantin Shcheglov 1be151dcce Give LibraryScope to AstRewriteVisitor.
We don't want to recreate these scopes.

R=brianwilkerson@google.com

Change-Id: I006c59af558e5f39c20e36811c17da05f5641818
Reviewed-on: https://dart-review.googlesource.com/77264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:01:23 +00:00
Konstantin Shcheglov e7e8786670 Replace MockSDK in analyzer_plugin to fix its tests on Windows.
I copied it from analyzer.

R=brianwilkerson@google.com

Change-Id: I6f39e4fca67deea9e0d0947cad2ff945feef09cf
Reviewed-on: https://dart-review.googlesource.com/77262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-30 17:07:51 +00:00
Konstantin Shcheglov 24208552ff Fix analyzer_cli tests on Windows.
Change-Id: I2fa5b38ed8cad00e198ec4b5ea7dbc44ec3288cb
Reviewed-on: https://dart-review.googlesource.com/77261
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-30 17:06:10 +00:00
Brian Wilkerson 5bcf91d973 Remove some dead code
Change-Id: Ida5c2ad29f943d676a6f16a51d66892b037ad099
Reviewed-on: https://dart-review.googlesource.com/77240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-30 16:32:38 +00:00
Konstantin Shcheglov fc130a0477 Extract ConstantVerifier.
R=brianwilkerson@google.com

Change-Id: I592447f443c7961aef10fbde260897864d5f9ddd
Reviewed-on: https://dart-review.googlesource.com/77244
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-29 18:16:04 +00:00
Konstantin Shcheglov fc96edc1ce Don't use AstRewriteVisitor in resynthesizer, build InstanceCreationExpression as we build expressions.
This makes the benchmark I'm using now about 15% faster.

The benchmark keeps unlinked and linked summaries in ByteStore.
After computing errors, it removes *.resolved keys.
So, the next cycle only reads file contents, performs resolution,
and computes errors.
This helps to make profiling results more focused.

Before: Computed errors in 28202 ms.
After: Computed errors in 24025 ms.

/Users/scheglov/Source/flutter/examples/flutter_gallery

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

    files: 708
/Users/scheglov/Source/flutter/examples/hello_world
    files: 49
/Users/scheglov/Source/flutter/examples/stocks
    files: 69
/Users/scheglov/Source/flutter/packages/flutter
    files: 911
/Users/scheglov/Source/flutter/packages/flutter_test
    files: 34
/Users/scheglov/Source/flutter/packages/flutter_tools
    files: 416
Change-Id: Ibcc36d60d6ffbab064e96fad5e44ed0a9bfcb929
Reviewed-on: https://dart-review.googlesource.com/77242
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-29 18:05:45 +00:00
Konstantin Shcheglov 25c659934a Change ResourceUriResolver to accept any file URI.
We don't really need to check that the corresponding resource is
a file. Now it is a file, or a directory, the moment later it is not.
We will try to read it, if we can - fine, if not - it does not exist.

This makes my Flutter analysis benchmark about 3% faster.

R=brianwilkerson@google.com

Change-Id: I955be276c7a694a408c70f8f2d47dce75594ebc8
Reviewed-on: https://dart-review.googlesource.com/77243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-29 17:23:00 +00:00
Brian Wilkerson 6c577f0620 Deprecate Element.isVirtual
Change-Id: I987ba5fbe847c961d698692e0e8b6c98cdbfb30c
Reviewed-on: https://dart-review.googlesource.com/77230
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-29 15:43:43 +00:00
Konstantin Shcheglov 5db21a7998 Tentatively re-enable PhysicalResourceProviderTest.
It still might be flaky and fail sometimes.
I will observe it, and if it is, I will extract file watching into
a separate suite, marked as flaky.

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

Bug: https://github.com/dart-lang/sdk/issues/25472
Change-Id: I82eadc7976f8f813cfaa1457735dee285a12aebd
Reviewed-on: https://dart-review.googlesource.com/77229
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-29 00:31:23 +00:00
Alexander Markov c78f67cc7e [vm/aot] Use TFA to detect dynamic, non-this and tear-off uses
TFA is improved to detect if a method was called using dynamic selector,
was ever called not via this, and whether the tear-off was taken.
This information is used to remove parameter type checks in AOT.

Less accurate selector-based analysis, which was used previously to get
this information, is now used only if TFA is disabled.

Also, precompiler is improved to omit method extractors and implicit
closure functions if analysis proved that tear-off is not taken.

Flutter gallery snapshot size: -0.8%

Change-Id: Iec01257dfdc78104752104df14e2ce078d326a96
Reviewed-on: https://dart-review.googlesource.com/77005
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-09-28 23:49:09 +00:00
Johnni Winther 41a875f420 Fix (super)mixins issues
Change-Id: I5892f2fec7fc7b7449fb600c74e4d105dc0f4bbe
Reviewed-on: https://dart-review.googlesource.com/77180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-28 23:03:24 +00:00
Brian Wilkerson da3e844cac Fix potential cast exceptions
Change-Id: I38f5565495b30393e0e559fe7fcae4c8bc247162
Reviewed-on: https://dart-review.googlesource.com/77226
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-28 22:06:24 +00:00
Konstantin Shcheglov 1bceca91b0 Remove the 'name' constructor parameter from CompilationUnitElementImpl()
It costed us about 1.2% of total analysis time.
The whole information about a unit is available in its Source.

R=brianwilkerson@google.com

Change-Id: Iffa253d1eae1a466c10766f66c6c677e19be124a
Reviewed-on: https://dart-review.googlesource.com/77220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-28 21:53:24 +00:00
Alexander Markov deb0645654 [vm/bytecode] Cleanup unused bytecode instructions
Change-Id: I956525dbeb3fdcb4b65a5530dbb59a96b4a02e81
Reviewed-on: https://dart-review.googlesource.com/77224
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-28 21:23:22 +00:00
Johnni Winther 085a63d2e7 Handle generic redirecting generative constructors
Closes #34479

Change-Id: I47f90891fa04d121ed2c3a10878b969b0f95729d
Reviewed-on: https://dart-review.googlesource.com/77062
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-28 20:33:10 +00:00
Konstantin Shcheglov 749cf15dcf Fix tests failing on Windows.
R=brianwilkerson@google.com

Change-Id: I72f01b89e03a3269cab9c8a33cbfb45c0bd13d72
Reviewed-on: https://dart-review.googlesource.com/77223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-28 20:20:36 +00:00
Konstantin Shcheglov af3337fbec Expose byteStore/performanceLog and AnalysisDriver from implementation.
I'd like to use these non-APIs in my benchmarks.

R=brianwilkerson@google.com

Change-Id: Ia85081dd6ccdfed9478a34459aadc8e802ff1072
Reviewed-on: https://dart-review.googlesource.com/77161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-28 20:12:55 +00:00
danrubel a73e0a840a Fix parsing partial named constructor
Fix https://github.com/dart-lang/sdk/issues/34614

Change-Id: I22d96780a32bc58f83e81c5c9d01c6c4992be581
Reviewed-on: https://dart-review.googlesource.com/77200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-28 19:53:10 +00:00
Konstantin Shcheglov 7298790ca6 Remove an invalid test from PhysicalResourceProviderTest.
TBR

This does not fix Windows bot, but I think will help for the Mac one.

Change-Id: I13d7914e60492e4865827e6c06359440aeeff29a
Reviewed-on: https://dart-review.googlesource.com/77221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-28 19:03:01 +00:00
danrubel 54f426c273 Auto-generate more analyzer error codes
Change-Id: Ib8e2b194bd101dcd17e2ceefd38aae03056afa5b
Reviewed-on: https://dart-review.googlesource.com/77141
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-28 17:26:29 +00:00
Konstantin Shcheglov 9c585bf5df Document that ResourceProvider requires absolute, normalized paths, and enforce this.
This allows us to avoid performing normalization, and work with paths
as is. So, this speeds up SourceFactoryImpl.restoreUri() from 7.5% to 3.7%

R=brianwilkerson@google.com

Change-Id: I085f3db40af6543fbb524a82fad48aa051e87937
Reviewed-on: https://dart-review.googlesource.com/77017
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-28 17:18:49 +00:00
danrubel 7c7417e170 Improve fasta parser mixin and class header recovery
This updates the parser to recover when
* 'extend' or 'extends' is used rather than 'on' in a mixin declaration
* 'extend' or 'on' is used rather then 'extends' in a class declaration

This also introduces a new ExpectedInstead error message to better
communicate to the developer the keyword that should be used.

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

Change-Id: Iafcb3d18db8ca3898c1e4dae74e5124c108ead48
Reviewed-on: https://dart-review.googlesource.com/77140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-28 17:11:49 +00:00
Alexander Markov 2aac05fe10 [vm/bytecode] Add specialized JumpIf* instructions
This change adds JumpIfEqStrict, JumpIfNeStrict, JumpIfTrue, JumpIfFalse,
JumpIfNull, JumpIfNotNull bytecode instructions. These instructions
supercede If*/Jump instruction patterns.

Change-Id: Icf9dc624001ce64d4b21409864591d693ead51d3
Reviewed-on: https://dart-review.googlesource.com/77011
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-28 16:29:23 +00:00
Peter von der Ahé 3f1955a97b Improve diagnostics about duplication in enums
Change-Id: I20f8ab79a8dbe6f2604f64cc26c2a91f46fcd2c2
Reviewed-on: https://dart-review.googlesource.com/76600
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-09-28 12:36:55 +00:00
Peter von der Ahé 8bf0e8e434 Document distance calculation in diet listener.
Change-Id: I6f9741c545c554ecdb62a19aeb85562213b86b13
Reviewed-on: https://dart-review.googlesource.com/76601
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-28 12:02:20 +00:00
Kevin Millikin dc2787a471 Remove parameterization of type inference
This is currently unused.  We might eventually resurrect it in some
form, but for now it is not doing anything for us.

Change-Id: Ib029fa8589b345bcf44a048a8c492fce9717e034
Reviewed-on: https://dart-review.googlesource.com/77061
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-09-28 09:48:31 +00:00
Peter von der Ahé 8ef3258e59 Remove _ConstantExpressionError
Change-Id: I0f7c590e826d9516d7b916cb6e39fd67eab97997
Reviewed-on: https://dart-review.googlesource.com/76662
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-09-28 08:41:53 +00:00
Peter von der Ahé 08a549d0ec Update messages_tests wrt multiple analyzer codes
Change-Id: Ie89b41be2d07bc7ca1a53dc691d0fcf71a7ee0dc
Reviewed-on: https://dart-review.googlesource.com/77040
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-28 07:18:27 +00:00
Jenny Messerly cfe9202393 [dartdevc] fix dart:mirrors type information for generic functions
This regressed in https://dart-review.googlesource.com/c/74664/.
In Analyzer FunctionType.typeFormals returns TypeParameterElements
instead of TypeParameterTypes; it is not safe to assume non-null bound
for elements.

Also fixes & clarifies the intent of _canEmitTypeAtTopLevel (formerly
_typeIsLoaded). There was no reason to visit the typeFormals, as generic
function types can always be emitted into the module.

Change-Id: Ia8b9271c2d1b66dca934d032dcbbe4fe89146f1b
Reviewed-on: https://dart-review.googlesource.com/76746
Reviewed-by: Alan Knight <alanknight@google.com>
2018-09-27 22:56:51 +00:00
Konstantin Shcheglov fa3d8fa567 Don't check for the file presence in transitive sets when we are just creating it.
Profiler showed that it was about 5% of total Flutter repo analysis time.

R=brianwilkerson@google.com

Change-Id: I172b93aaf4c25dec2de7798249984f2ef493807c
Reviewed-on: https://dart-review.googlesource.com/77008
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-27 22:01:30 +00:00
Dan Rubel 0518b334ba Address comments
Address comments in https://dart-review.googlesource.com/c/sdk/+/77021

Change-Id: I2a603d77002933692e6b14deba68b227cf4981e3
Reviewed-on: https://dart-review.googlesource.com/77023
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-27 21:24:53 +00:00
Dan Rubel 7c46a28505 Update convert class to mixin assist to remove "abstract"
Change-Id: I27ff36228b6c93d13a2f6d5f0a4c15414c130687
Reviewed-on: https://dart-review.googlesource.com/77022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-27 21:07:03 +00:00
Konstantin Shcheglov 06744c68b2 Pull reporting for unimplemented inherited members, and declared abstract members from ErrorVerifier.
When we need to check that the concrete implementation is valid for
the class interface, we already know whether we have the required
concrete implementation, or if it is left abstract. So, we can report
corresponding errors without additional computation.

R=brianwilkerson@google.com

Change-Id: Ib6d19bab024572c26853c16f22adb8a545a2e304
Reviewed-on: https://dart-review.googlesource.com/77006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-27 21:01:12 +00:00
Dan Rubel 45c7e4365c Update dartfix to apply changes to file rather than displaying them
This CL updates dartfix to make the recommended changes after
prompting the user to confirm that these changes should be made.
If the source contains errors that might affect the correctness
of the automatically applied fixes, then a warning is issued
before prompting the user.

This CL also addresses comments in
https://dart-review.googlesource.com/c/sdk/+/77020

Change-Id: Ie609247616dd033aa16af8d7e6e38a9eb4cbf0d0
Reviewed-on: https://dart-review.googlesource.com/77021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-27 20:59:02 +00:00
Jenny Messerly 9ad59bada2 [dartdevc] fix #34358, int to double conversion for literals
Also fix #34360 by addressing a few remaining Analyzer issues.

Change-Id: Iac3d9ba72aa370846fced3654a376899b5938152
Reviewed-on: https://dart-review.googlesource.com/76343
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-27 20:15:20 +00:00
Dan Rubel edddc0ba58 Generate source changes for converting class to mixin
This uses the AssistProcessor to generate the source changes
and pass them to the client. In a subsequent CL, the client
will apply those changes instead of displaying them.

Additionally, this CL addresses comments in
* https://dart-review.googlesource.com/c/sdk/+/76760
* https://dart-review.googlesource.com/c/sdk/+/76520

Change-Id: I1e9cb4e079ec79a06db4c4d04a062c71107c0f21
Reviewed-on: https://dart-review.googlesource.com/77020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-27 19:32:20 +00:00
Alexandre Ardhuin 51b8fc7bb0 AwaitExpression.precedence => 14
Fixes #34597

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

GitOrigin-RevId: d691e0b7733034a22d2d22e436d69f32d04e7df1
Change-Id: I63985683ee492f6a2dd60f0b4cc41437c6a65d65
Reviewed-on: https://dart-review.googlesource.com/76880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-27 16:24:05 +00:00
Brian Wilkerson 2390b3605f Create a package for shared diagnostics
Change-Id: I7e43d4c738a187a608f98f008770b169839de1ce
Reviewed-on: https://dart-review.googlesource.com/76722
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-09-27 16:23:20 +00:00
danrubel 629d76eb46 Simple dartfix that suggests class to be converted to mixins
... and update protocol spec errors generated by edit.dartfix

Change-Id: I3708eb9ffa40f91ff9bf172d20d75346f481e4d8
Reviewed-on: https://dart-review.googlesource.com/76760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-27 15:44:45 +00:00
Konstantin Shcheglov 8a2cfd8613 Implement InheritanceManager2.getMember() and use it in some places.
R=brianwilkerson@google.com

Change-Id: I3a778291587a1749e127c4e6cb8b2c8ae3fe00e9
Reviewed-on: https://dart-review.googlesource.com/76801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-27 15:34:49 +00:00
Daniel Hillerström 71eaf3209b Fix broken 'fasta testing sdk'.
This CL fixes some bugs and regressions in the 'fasta testing sdk' tool:

  * Plugs the excessive memory leak in suite.dart (thanks to jensj
    for helping tracking it down)
  * Fixes the signature of MultitestTransformer.bind such that it no
    longer causes a type error to happen at runtime.
  * Removes the code that disallows test name "none".
  * Updates the exclude list in testing.json

Change-Id: Ie850139c2228550c9847883d4fdaed839a052200
Reviewed-on: https://dart-review.googlesource.com/76840
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
2018-09-27 13:08:47 +00:00
Peter von der Ahé b36f4fffc4 Allow multiple analyzer codes
Change-Id: I0f942389f52b8302bac8b1bd0cedee1e35811056
Reviewed-on: https://dart-review.googlesource.com/76940
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-27 11:52:37 +00:00
Johnni Winther 82b3501c3c Fix supermixin handling in dart2js
Change-Id: I77251a1b90f62e1c103f018bdd15a7ae385008ee
Reviewed-on: https://dart-review.googlesource.com/76941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2018-09-27 11:44:53 +00:00
Kevin Millikin c9b05d3f1f Allow super calls in mixin declarations
Allow super calls to occur in mixin declarations if they target a
method from any of the superclass constraint interfaces.

Instead of compiling the Dart mixin declaration
    mixin M on S0, S1 {...}
to Kernel:
    abstract class _M&S0&S1 = S0 with S1;
    abstract class M extends _M&S0&S1 { ... }
we compile it to Kernel:
    abstract class _M&S0&S1 implements S0, S1 {}
    abstract class M extends _M&S0&S1 { ... }
because the former is not symmetrical with respect to S0 and S1.  It
will prefer a method from the 'mixin' S1 over one from S0 which can
give a compile-time error if the method from S0 is more general.

Modify mixin inference to support the new compilation of mixin
declarations.  It still has to support old-style VM super mixins until
support for those is removed from the VM.

Change-Id: Ib945aa11cc19c457b07bc802beae10d1663ff6b7
Reviewed-on: https://dart-review.googlesource.com/76141
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-09-27 10:19:30 +00:00
Johnni Winther 225b8d5075 Specialize Object properties in static type computation
This normalizes all accesses of Object properties on dynamic receivers
to target the corresponding Object members.

CFE already set the interface target on for instance `a == b` where `a`
has static type `dynamic` but didn't for the implicit call to `==` in
for instance `a?.b`.

Change-Id: I4f714766ac33a431f5ef645df7ee1bbb254c06ce
Reviewed-on: https://dart-review.googlesource.com/76123
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-09-27 09:51:01 +00:00
Johnni Winther 4a58112a7c Move kernel_impact.dart from ssa/ to kernel/
Change-Id: I284aaea0f2743017ec2d0042de7453f479586f03
Reviewed-on: https://dart-review.googlesource.com/76666
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-27 09:00:56 +00:00
Johnni Winther e9c949372e Remove unused parts of J/K*Env classes
Change-Id: I5aa5f5cb5504f5479ab9b18960246fb68b56d02c
Reviewed-on: https://dart-review.googlesource.com/76665
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-09-27 08:17:56 +00:00
Johnni Winther 4659cb9480 Fully split JsToElementMap and KernelToElementMap
- including the first benefit: Removing Class/Member definitions from the K-world.

Change-Id: I440dce2e37758dd276a417851f67a1403f6535a0
Reviewed-on: https://dart-review.googlesource.com/76641
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-27 08:17:56 +00:00
Daniel Hillerström a617700b17 Removes code that has become redundant since 98a9adf.
98a9adf696

Change-Id: I7c387e63aa1bbb2c1583952f6e1ada03d8070378
Reviewed-on: https://dart-review.googlesource.com/76663
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
2018-09-27 07:56:30 +00:00
Alexander Markov 5d10974a89 [vm/bytecode] Use _simpleInstanceOf for certain 'is' checks in bytecode
DeltaBlue benchmark, platform with bytecode, pure interpreter mode
(--enable-interpreter --compilation-counter-threshold=-1), best of 5 runs:
Before: DeltaBlue(RunTime): 391061.47400000005 us.
After: DeltaBlue(RunTime): 285747.36557142856 us.

Change-Id: I875f227cf19e0f75687c13910b1d957ee595652b
Reviewed-on: https://dart-review.googlesource.com/76708
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-26 21:50:41 +00:00
Alexander Markov 0f5968945c [vm/aot] Do not tree shake type arguments used in constant instances
Change-Id: I2a3c6f8ed8e31ebcbd1329fbf5997d1cad558daf
Reviewed-on: https://dart-review.googlesource.com/76744
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-26 21:42:36 +00:00
Paul Berry 99daccc0dd Handle FunctionExpressionInvocation when creating summaries.
Fixes #34514.

Change-Id: I46544a0a188b4cc0cb8061669ccbb0f7fa394995
Reviewed-on: https://dart-review.googlesource.com/76741
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 21:23:18 +00:00
Jenny Messerly d673847bd8 [dartdevc] add --kernel option, deprecate bin/dartdevk
`dartdevc --kernel` is now equivalent to the old `dartdevk` command.
This will make migration easier, as it's now just a flag to enable
CFE/Kernel. `dartdevk` is now deprecated, but it can be supported for
a while as it just calls `dartdevc --kernel`.

Change-Id: Ib8d09f74556740a3af11c753f80cd87bd4a09044
Reviewed-on: https://dart-review.googlesource.com/76566
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-09-26 21:18:06 +00:00
Régis Crelier 79d639a3a8 [VM interpreter/bytecode] Modify argument order for AssertAssignable bytecode.
The new argument order matches the runtime call and requires less copying.
Simplify Function::HasCode()
Remove obsolete workaround when updating type test cache.

Change-Id: I57c988f97ee2259a22730f445f336cd2a085959e
Reviewed-on: https://dart-review.googlesource.com/76584
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-26 21:15:16 +00:00
Konstantin Shcheglov 9fb3ff1f1a Extract InheritanceManager2.
Refactor it.

Use Name object to check that a particular member is accessible in
a particular library.

R=brianwilkerson@google.com

Change-Id: Id057e9336da8e8f97adedd1256a69ca3de267414
Reviewed-on: https://dart-review.googlesource.com/76585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-26 20:54:30 +00:00
Paul Berry dcad8fe895 In analyzer/FE comparison, compare the return types of function types.
This was inadvertently left out of the initial implementation.

Change-Id: I930bb77baad2e10e61836c15453729711d54cbde
Reviewed-on: https://dart-review.googlesource.com/76724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 19:33:21 +00:00
Paul Berry e31f9fc55f Track front end errors.
In a later CL I will add code to print out the errors in the case
where the front end detects errors but the analyzer does not.

Change-Id: I675a9ffcce7cfe7afa32406b3310e7b1d42d2afc
Reviewed-on: https://dart-review.googlesource.com/76720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 17:42:32 +00:00
Paul Berry 0262530e1f Clarify code that checks for analyzer/FE differences.
We take a slight performance hit when differences are actually found
(since we now check for differences first, and then compute the diff
afterwards if differences were found), but this shouldn't be a big
problem since most of the time there are no differences.

Change-Id: I62957bc7ea3ef2e87afdf7ea175ea5e4e75fc1aa
Reviewed-on: https://dart-review.googlesource.com/76703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 17:05:25 +00:00
Konstantin Shcheglov 4dcd8392fc Allow super invocations find members in supertypes of old style mixins.
We should delete this code once Flutter switches to the new mixins.

R=brianwilkerson@google.com

Change-Id: Ib57d9093dade0d926386647f47f91918e92a51f2
Reviewed-on: https://dart-review.googlesource.com/76700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-26 15:38:42 +00:00
Dan Rubel a0ff5f8b3f Add stub implementation for analysis server edit.dartfix
Change-Id: Iefaec93366c5a6910e3c2e7dfebc91e8905922c2
Reviewed-on: https://dart-review.googlesource.com/76520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-26 14:31:27 +00:00
Lasse R.H. Nielsen 429bca8e65 Make Uri.parse accept [ and ] in path, query and fragment.
Also accept `#` in fragment.
Fix bug in parsing URI where first character of path needs escaping.
The characters are escaped, but parsing doesn't fail, like it previously
did on misplaced general delimiters in those places

Fixes #34451.

Bug: https://dartbug.com/34451
Change-Id: I99aa39bd2909661802ad9d1bb5dada94d579141b
Reviewed-on: https://dart-review.googlesource.com/74780
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-09-26 14:09:37 +00:00
Peter von der Ahé b480089a1a Fix updateExpectations in expression test
Also disable colors unconditionally.

Change-Id: Ib69777267c4f41595634c6f28c71d4db9c96feb9
Reviewed-on: https://dart-review.googlesource.com/76668
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-26 13:28:44 +00:00
Daniel Hillerström 98a9adf696 Make constructor function types conform with the specification.
Prior to this CL the return type of any constructor function was
always void. According to the specification §9.3 the return type of a
constructor function ought to be its enclosing class.

Change-Id: I70d76cc354b7f118ce96bf4954daf7fe535eb7be
Reviewed-on: https://dart-review.googlesource.com/76160
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-09-26 09:39:11 +00:00
Peter von der Ahé a3aa0c18fb Improve messages involving empty cycles
Change-Id: I4a6732bcce9ddb98cd00e60e8d46fae1dd4b9599
Reviewed-on: https://dart-review.googlesource.com/76500
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-26 07:45:12 +00:00
Peter von der Ahé 48d1b5e64b Improve diagnostics with anonymous jump targets
Change-Id: Ia904bc8d865c7a3302d4428d3dbf3660a7570f9e
Reviewed-on: https://dart-review.googlesource.com/76605
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-26 07:45:12 +00:00
Stephen Adams 1a29217509 Remove empty statements
TBR=sigmund@google.com

Change-Id: I352bdc7f8031d797ec612a369341f93c7fbb1557
Reviewed-on: https://dart-review.googlesource.com/76586
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-09-26 03:35:08 +00:00
Jenny Messerly 1c8d65c49b fix #32785, implement typedef equality in dartdevc
This change expands typedefs into their underlying function type in the
compiler. Typedefs no longer exist at runtime in DDC, so they now have
similar equality and identity behavior as other function types.

The compiler used to preserve typedefs so they could have a better
toString. But over time that support has been almost entirely lost;
the caching for function/interface types eliminates typedefs, and
DDC+Kernel does not appear to get any TypedefTypes from the common
front end. So in practice typedef types were almost never present at
runtime. Because of this, we can remove the remaining support with very
little user visible effect. This also brings DDC's canonicalization
roughly in line with dart2js for compile-time typedefs, so frameworks
like Angular will be able to continue their use of `identical` for fast
type comparisons.

This CL also fixes DDC's type caching for generic function types
(typeHashCode was incorrect for them), and has some refactoring to
improve names/comments and make the SDK runtime code more clear.

Change-Id: I4e34c0c8f737a8535ba474a4683967ff41bcd3c8
Reviewed-on: https://dart-review.googlesource.com/74664
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2018-09-26 02:01:45 +00:00
Stephen Adams 20fa7815f0 Add @pragma('dart2js:noInline') and @pragma('dart2js:tryInline')
This is a redo of "[dart2js] Simplify noInline / tryInline annotations"
but keeping compatibility between different versions of dart2js and package:meta

Change-Id: I30e48f374aeef13d99f41af81eb0b8f339ab8bb8
Reviewed-on: https://dart-review.googlesource.com/76581
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-09-26 01:19:50 +00:00
Paul Berry b1a54154f8 Check that implicit type arguments satisfy bounds.
This required adding an implementation of super-bounded types to the
analyzer.

We really could use some more tests to verify that we disallow
super-bounded types in all the appropriate locations, but allow it in
other cases (it seems that there are no language_2 tests to verify
this).  To avoid churn, I'll wait until I have confirmation that my
reasoning is correct in #34583 before submitting test cases.

Fixes #34532.
Fixes #34560.

Change-Id: I3c5def60bcac0d31b56bead31cb1aab445f18e96
Reviewed-on: https://dart-review.googlesource.com/76280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-26 01:12:28 +00:00
Jenny Messerly 3b511b9439 [dartdevc] improve compile time of kernel backend
- avoids creating a second analyzer summary resynthesizer
- avoids creating a new class hierarchy

Change-Id: Idd9e2952f1ab46b2a5d58bbc40fa2be5c1604d5e
Reviewed-on: https://dart-review.googlesource.com/76062
Reviewed-by: Alan Knight <alanknight@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-09-26 01:02:05 +00:00
Alexander Markov f81709c3e3 [vm/aot] Use field types inferred in TFA and remove inference in precompiler.cc
Type inference for final fields in precompiler.cc is limited and
does not properly handle constant objects.

This change hooks up field types inferred by TFA and removes the
inference in precompiler.cc.

Fixes: https://github.com/flutter/flutter/issues/22131

Change-Id: Ida65cd211074623928bb2a7d48dc58d5e53511b8
Reviewed-on: https://dart-review.googlesource.com/76562
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-25 23:26:09 +00:00
Stephen Adams ded73cdd08 Revert "[dart2js] Simplify noInline / tryInline annotations"
This reverts commit 8bae3a1cfd.

There are versioning issues that need to be addressed.

TBR=kevmoo@google.com

Change-Id: Ia82e94f127523db650e4df03af1179ef94463bee
Reviewed-on: https://dart-review.googlesource.com/76564
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-09-25 22:11:42 +00:00
Brian Wilkerson 2c82a400e8 Signal a static error when invoking a non-function (issue 34320)
Change-Id: Ida2998b44f52185fcd1d3be545004edff917f5ad
Reviewed-on: https://dart-review.googlesource.com/76560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 20:52:35 +00:00
Stephen Adams 8bae3a1cfd [dart2js] Simplify noInline / tryInline annotations
Use @pragma for dart2js.noInline / dart2js.tryInline

Change-Id: Id7932ad7f85b91e4c1e427bb88e782ede81d5926
Reviewed-on: https://dart-review.googlesource.com/76341
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-09-25 19:08:14 +00:00
Konstantin Shcheglov 9185294e7a Reland: Implement inheritance/override checks from the spec.
Relands https://dart-review.googlesource.com/c/sdk/+/76061
Was reverted in https://dart-review.googlesource.com/c/sdk/+/76301

The difference with the original CL is that we don't look into
superclass and mixins of mixed-in for concrete members. This reduces
the number of errors in Flutter codebase to 1.


R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: I86256b598d116439194cbaf4d09b4f72013d6563
Reviewed-on: https://dart-review.googlesource.com/76340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 18:51:04 +00:00
Paul Berry c23a9815ec Stop setting element model supertypes in TypeResolverVisitor when using new driver.
It's not necessary (because these types are already set correctly by
the summary linker) and it causes incorrect behavior (because due to
issue #34579 the AST nodes don't always contain correct types).

This reduces the severity of #34579 by ensuring that the incorrect
types stay in the AST nodes and don't leak into the element model.
I'll leave that issue open to remind us to make a more complete fix.

Change-Id: Ibf39370d501b5e19c9dc75713f2c39ca732870d6
Reviewed-on: https://dart-review.googlesource.com/76441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 17:46:50 +00:00
Konstantin Shcheglov 17b3310400 Resolve bounds for type parameters of generic type alias.
R=brianwilkerson@google.com

Change-Id: Iff270adcd55d0a8c3a0bfaeed2c0741ccb1a1c77
Reviewed-on: https://dart-review.googlesource.com/76440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 17:21:04 +00:00
Dan Rubel c624f8b0a9 First cut dartfix protocol
and address comments in https://dart-review.googlesource.com/c/sdk/+/76320

Change-Id: I5c7ab40810d4116b1d36de90b7234d0a932bae82
Reviewed-on: https://dart-review.googlesource.com/76400
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 16:56:48 +00:00
Brian Wilkerson a6b1a99f4c Make mixins abstract by default
Change-Id: I8ca672ac9d6acbb29ccea1bd41a617e0a870c74a
Reviewed-on: https://dart-review.googlesource.com/76303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 15:45:07 +00:00
Peter von der Ahé ab305f2f26 Recover from duplicated declarations
Before, a duplciated declaration would cause the compiler to abort using
deprecated_InputError.

Change-Id: Ide8d13802045e9a349f0f408a6d174a47c7f6418
Reviewed-on: https://dart-review.googlesource.com/76122
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-09-25 14:53:58 +00:00
Peter von der Ahé 4e32a356e0 Ignore synthetic elements created by the parser
Change-Id: I558827417c938a22075c5b5357294d27cbd6286a
Reviewed-on: https://dart-review.googlesource.com/76121
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-25 14:15:23 +00:00
Johnni Winther 1652850381 Compute static types during impact computation
This speeds up the computation of static type by avoiding repeated
visits of subtrees. The change also paves the way for improving
static type computation beyond what is specified. For instance by
handling negative type promotions.

Change-Id: Ifa3ea0f9760251f43cbbcc97b684004741a97b11
Reviewed-on: https://dart-review.googlesource.com/76020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-09-25 09:58:19 +00:00