Commit graph

47021 commits

Author SHA1 Message Date
Paul Berry 830be5727d Minor type inference fixes to do with null and bottom types.
This CL makes the following fixes:

- Updates analyzer's front_end_inference_test to represent the bottom
  type as "<BottomType>" (consistent with Kernel).

- Implements type inference of "throw" expressions.

- Does not coerce bottom to dynamic when inferring the return type of
  a closure.

- Does not coerce Null to dynamic when inferring the return type of a
  block closure.

- Ignores bare "return;" statements when inferring the return type of
  a block closure.

- Infers Null when a block closure lacks "return <expression>;"
  statements.

- Implements correct rules for LUB(Null, x), by treating Null as
  bottom.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2886873005 .
2017-05-17 05:36:11 -07:00
Konstantin Shcheglov 6c8733dcbd Fix for the compilation error.
Somehow was not displayed in my analysis view :-(

TBR

R=sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2886993003 .
2017-05-16 19:11:40 -07:00
Paul Berry 72d3fbc85f Implement type inference of static invocations.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2885963002 .
2017-05-16 18:33:24 -07:00
Konstantin Shcheglov 43cea08f6d Fixes for review comments.
R=sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2889463002 .
2017-05-16 17:27:37 -07:00
Stephen Adams 750de777cf js_array tweaks
- uniform quotes
- uniform naming of methods in _checkGrowable
- use .slice(0), it is slightly faster than .slice()
- avoid bounds and type checks in removeWhere/retainWhere

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2880643005 .
2017-05-16 16:38:13 -07:00
Alan Knight 6b525831f6 Fix typo in status file
BUG=

Review-Url: https://codereview.chromium.org/2891593002 .
2017-05-16 15:38:15 -07:00
Alan Knight 0ea9e4402d Suppressions for dart2js-drt roll 50. Issue 29632
BUG=

Review URL: https://codereview.chromium.org/2886003002 .
2017-05-16 15:16:57 -07:00
Konstantin Shcheglov e3f4ed94b1 Rename Target.writeOutline() into computeOutline(), add separate KernelTarget.writeOutline().
For DillTarget write does not make sense, and even for KernelTarget
we usually don't want to write anything.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2885923002 .
2017-05-16 14:38:24 -07:00
Paul Berry 798890256f Refactor common code between method and constructor inference.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2890633002 .
2017-05-16 14:09:04 -07:00
Brian Wilkerson cb258a952c Remove unused contentHash from results
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2885203002 .
2017-05-16 14:08:11 -07:00
Stephen Adams 9c3d439b1e dart2js + html: getBoundingClientRect() returns a ClientRect
Gives better code since the general Rectangle requires getInterceptor
dispatch.

BUG= https://github.com/dart-lang/sdk/issues/29602
R=jacobr@google.com, terry@google.com

Review-Url: https://codereview.chromium.org/2879403002 .
2017-05-16 13:48:04 -07:00
pq aa491e7133 Support tear-off completions for named params (in constructors) (flutter-intellij#836)
R=danrubel@google.com

Fixes: https://github.com/flutter/flutter-intellij/issues/836
Review-Url: https://codereview.chromium.org/2883363002 .
2017-05-16 13:40:33 -07:00
Alan Knight cf9d7a872e Supress Safari Roll 50 errors - Issue 29632
BUG=

Review-Url: https://codereview.chromium.org/2883423002 .
2017-05-16 13:01:07 -07:00
Jacob MacDonald 7404b586cb fix mac pub tests
BUG=
R=nbosch@google.com

Review-Url: https://codereview.chromium.org/2888563003 .
2017-05-16 12:40:55 -07:00
Konstantin Shcheglov 87680e5923 Fix computing export scopes for library cycles and after loading.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2885883002 .
2017-05-16 11:37:57 -07:00
Jacob MacDonald b60cfc2edc update pub and barback for ddc support
BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2889683002 .
2017-05-16 10:52:00 -07:00
Konstantin Shcheglov 97cf17c322 Compute export namespaces for DILL libraries.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2886563002 .
2017-05-16 10:02:43 -07:00
Paul Berry 6a48f79ba3 Disable type erasure during strong mode tests.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2883343002 .
2017-05-16 09:47:21 -07:00
Paul Berry d99ba36b5e Remove generic parameters from type inference classes.
Previously, these classes were generic because we anticapted re-using
them with analyzer AST objects in order to do analyzer type inference.
But we've decided on a new technique for doing analyzer type
inference: infer at the kernel level and then transfer the inference
data to analyzer using the TypeInferenceListener.

So the generic parameters are no longer needed.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2885873002 .
2017-05-16 09:34:53 -07:00
Paul Berry 42ef3eb144 Analyzer CLI: fix machine format in build mode.
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2885063002 .
2017-05-16 09:01:49 -07:00
Paul Berry 77f349880c Add a comment to refer to bug #29629.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2886783003 .
2017-05-16 08:55:14 -07:00
Dan Rubel 278c7bfbeb merge fasta.Token into analyzer.Token
This eliminates much of the duplication between the two token hierarchies
by merging much of the fasta.Token hierarchy into the analyzer.Token.

* merge token hierarchies
* cleanup fasta.Token.copy()
* set preceedingComments field via constructor
* replace isBuiltInIdentifier --> type.isBuiltIn
* change all fasta.Token references to analyzer.Token
* move fasta.Token.value() implementation into analyzer.SimpleToken

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2890523002 .
2017-05-16 11:50:14 -04:00
Konstantin Shcheglov e118615103 Include only changed or affected libraries into delta.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2885743002 .
2017-05-16 08:49:48 -07:00
Paul Berry 51eb5cef42 Minor type inference fixes.
- Add num::== and Iterable::where to analyzer mock SDK.

- Do not default parameter types to dynamic in BodyBuilder or
  KernelFormalParameterBuilder.  This is now handled by the
  KernelVariableDeclaration constructor.

- Only infer function expression parameter types in strong mode.

- Record inferred function expression parameter types to
  instrumentation.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2886443003 .
2017-05-16 08:42:25 -07:00
Terry Lucas 3160698fb7 Revert "Test that all bots successes"
This reverts commit a9a4f84549.

Revert "Test that all bots successes"

This reverts commit dc7ee5d872.

BUG=

Review-Url: https://codereview.chromium.org/2881353002 .
2017-05-16 05:40:27 -07:00
Dan Rubel d566906167 cleanup unused incremental resolution
* remove unused analyzer incremental resolution
* remove unused Token.applyDelta method

Patch Set 1 is the original CL that was landed and reverted
https://codereview.chromium.org/2876993005

Patsh Set 2 contains additional fixes and test changes

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884853002 .
2017-05-16 07:53:17 -04:00
Zhivka Gucevska d4b73fd9ee Refactor string concatenation evaluation
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2883813004 .
2017-05-16 12:53:44 +02:00
Johnni Winther 3b2ca15f62 Fix name in status file
Review-Url: https://codereview.chromium.org/2883063004 .
2017-05-16 11:28:30 +02:00
Johnni Winther dff23682a1 Create closed world for hello world using .dill file
Currently results in compile time error because of a bug in the kernel reuse of mixin applications.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2865693002 .
2017-05-16 10:30:05 +02:00
Vijay Menon ad7f257f9b Fix nullaware dynamic dispatch
Fixes #29610

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2880103004 .
2017-05-15 20:47:10 -07:00
Terry Lucas dc7ee5d872 Test that all bots successes
TBR=jacobr@google.com

Committed: a9a4f84549
Review-Url: https://codereview.chromium.org/2881093002 .
2017-05-15 19:15:55 -07:00
Brian Wilkerson 4c487c806b Minor cleanup of error reporting in plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2887453004 .
2017-05-15 16:48:23 -07:00
Jacob Richman 61b0cbd685 Fix language/stacktrace_rethrow_error_test_withtraceparameter_multi test
Fix is to remove unexpected frames on the stack trace by inlining
all calls to determine current DDC configuration settings.

BUG=
R=leafp@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2879393002 .
2017-05-15 16:27:42 -07:00
Bob Nystrom 01e5b1b40c Revert "Refactor and clean up the status file parsing code."
This reverts commit 0b7728da1b.

R=nbosch@google.com

Review-Url: https://codereview.chromium.org/2885623002 .
2017-05-15 15:58:05 -07:00
Bob Nystrom 0b7728da1b Refactor and clean up the status file parsing code.
- Make the parser less error tolerant. The expression parser used to
  ignore any unrecognized tokens, which means a status like
  "RuntimeError CompileError" (not the missing comma) was parsed as
  simply "RuntimeError", which seems bad. Now it reports an error.
  Fixed a couple of status files that thought they were setting statuses
  that they weren't (!).

- Separate out parsing a status file from applying the environment to
  determine which sections are active. This makes it possible to, for
  example, generate expectation sets for multiple environments without
  having to reparse each time.

- Simplify expression parsing. Remove set expressions since they weren't
  used for anything useful. A test's expectations are a simple
  comma-separated list and don't need anything beyond that. Merge
  Scanner and Tokenizer since the latter was a glorified function.

- Make more names private so that it's clearer what's used outside of
  various libraries.

- Generally modernize the style.

- Add *lots* of documentation.

Again, there should be no behavioral changes. I ran:

  ./tools/test.py -m release,debug -c none,dart2js,dart2analyzer -r none,vm,d8 corelib

Before and after the change and verified that the output was the same
(aside from timing).

BUG=
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2875203005 .
2017-05-15 15:42:15 -07:00
Bob Nystrom e0180925f6 Tighten up a bunch of types in test.dart.
This doesn't get rid of all implicit dynamic and casts, but it covers
many of them.

Also did some minor modernization when I noticed it:

- Using "var" for local variables where inference does the right thing.
- camelCase for variable names.
- More collection literals.

There are (or should be!) zero behavioral changes.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2863253002 .
2017-05-15 15:26:40 -07:00
Stephen Adams 89b9c7c8dd html: AudoTrackList is a List
BUG=
R=terry@google.com

Review-Url: https://codereview.chromium.org/2884813002 .
2017-05-15 14:44:35 -07:00
Paul Berry c519414702 Add subtype matching rules for function types.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2883133002 .
2017-05-15 14:04:32 -07:00
Konstantin Shcheglov b3837a5e28 Enhance DirectiveListener to collect import/exports with combinators.
We need combinators to build export scopes for DILL libraries.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2884783002 .
2017-05-15 13:59:14 -07:00
Brian Wilkerson a03958bfc9 More clean-up after getting common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2880393002 .
2017-05-15 13:01:57 -07:00
Paul Berry 358c3da935 Make type inference handle overloaded arithmetic operations.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2883083002 .
2017-05-15 11:43:50 -07:00
Stephen Adams 35979c3205 Add keyLocation to KeyboardEvent constructor for backwards compatibility
BUG=
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2884713002 .
2017-05-15 10:58:24 -07:00
Alexander Aprelev b0c6a59731 Fix analyzer tests in checked mode.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2884023002 .
2017-05-15 10:25:59 -07:00
Brian Wilkerson 6643349a8f Minor clean-up
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2885473002 .
2017-05-15 10:09:47 -07:00
Paul Berry a4bdc5cb4e Make another type inference test pass.
Type inference for this test was already working; it just needed an
expectation file and a main function.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2882953003 .
2017-05-15 10:00:49 -07:00
Brian Wilkerson 0b5bee6c66 Fix a failing test (TBR)
Review-Url: https://codereview.chromium.org/2877353003 .
2017-05-15 09:49:22 -07:00
Alexander Aprelev 8d647ad9b8 Fix test by using private_key parameter.
This fixes error introduced by my previous cl https://codereview.chromium.org/2869573002.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2877293002 .
2017-05-15 09:36:59 -07:00
Brian Wilkerson fb982f5476 Make server use the common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
William Hesse 6f3d45f5a3 Check for infrastructure failure before reporting timeouts and crashes.
BUG=http://dartbug.com/28955

Review-Url: https://codereview.chromium.org/2881073002 .
2017-05-15 18:27:46 +02:00
Brian Wilkerson 38143be701 Fix an error to fix the bots (TBR)
Review-Url: https://codereview.chromium.org/2883883003 .
2017-05-15 09:11:12 -07:00