Commit Graph

6018 Commits

Author SHA1 Message Date
Peter von der Ahé cbcb7d4885 Clean up handling of types.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2915933004 .
2017-06-02 14:53:20 +02:00
Peter von der Ahé 0db20bf56a Add testing configuration for Fasta.
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2919043002 .
2017-06-02 14:29:43 +02:00
Peter von der Ahé 696f00d96b Implement library access restrictions and privacy.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2916863003 .
2017-06-02 13:13:38 +02:00
Dmitry Stefantsov 0b424ca5d2 Revert "Use backend targets to run Kernel transformations in Fasta"
This reverts commit 8ff762067a.

TBR=ahe@google.com

Review-Url: https://codereview.chromium.org/2918923003 .
2017-06-02 12:45:34 +02:00
Dmitry Stefantsov ece423de17 Revert "Use 'outline.dill' instead of 'platform.dill' in kernel isolate"
This reverts commit 303ab0aa96.

TBR=sigmund@google.com

Review-Url: https://codereview.chromium.org/2919003002 .
2017-06-02 12:18:54 +02:00
Dmitry Stefantsov 303ab0aa96 Use 'outline.dill' instead of 'platform.dill' in kernel isolate
R=ahe@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2916083002 .
2017-06-02 10:53:40 +02:00
Dmitry Stefantsov 8ff762067a Use backend targets to run Kernel transformations in Fasta
R=ahe@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2918623004 .
2017-06-02 10:40:13 +02:00
Paul Berry eefdf15aa1 Perform type inference on default values of optional/named parameters.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2915763008 .
2017-06-01 21:18:37 -07:00
Paul Berry 3babf830e7 Remove remaining references to defunct parameter --failure-summary.
As of db06324975, this parameter is no
longer supported by the test framework.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2915933005 .
2017-06-01 21:13:14 -07:00
Paul Berry 8ae9237efd Clean up type inference for PropertySet.
These changes are follow ups to
cd5bacbc54.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2916273002 .
2017-06-01 20:56:43 -07:00
Paul Berry da869cff4e Fix inference test annotation of named/optional parameters in function types.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2915913004 .
2017-06-01 20:51:29 -07:00
Paul Berry d17f3f3bbd Annotate optional parameter inferred types in front end test cases.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2921533004 .
2017-06-01 20:45:51 -07:00
Paul Berry 349f95f687 Fix a corner case of block closure inference.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2914983003 .
2017-06-01 16:07:59 -07:00
Paul Berry eec5e74188 Normalize URIs on entry to ValidatingInstrumentation.
This makes it possible to remove a type inferrer hack that wouldn't
have worked properly with part files.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2921683002 .
2017-06-01 09:54:56 -07:00
Konstantin Shcheglov 5bdfd1e69b Pass ClassHierarchy instead of creating it.
MixinFullResolution is also updated to create new ClassHierarchy
instance only if there are transformed classes. This improves
incremental kernel generator initial time from 22 to 16 seconds.

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

Review-Url: https://codereview.chromium.org/2918593003 .
2017-06-01 07:20:13 -07:00
Peter von der Ahé 5b94cfe33a Various infrastructure changes.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2917863003 .
2017-06-01 15:16:18 +02:00
Peter von der Ahé 984b13052d Compute correct return type for factory methods.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2917853002 .
2017-06-01 14:02:05 +02:00
Peter von der Ahé 679cd68453 Update expectations files.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2921623002 .
2017-06-01 14:01:12 +02:00
Paul Berry 7cdf85da06 Fix a corner case of function type inference.
When an expression function's expression has type `dynamic` (or
`Null`, since `Null` is coerced to `dynamic`), the inferred return
type is taken from the context.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2921583002 .
2017-05-31 21:26:14 -07:00
Sigmund Cherem 2046d08c09 Fix error recovery for extracting native name.
I discovered this now that native is
enabled more widely (see bot failures here:
https://build.chromium.org/p/client.dart/builders/vm-kernel-linux-release-x64-be/builds/2731/steps/vm%20tests/logs/stdio)

Here is an example input that hit the problem:

  K() sync* {}; // //# 50: compile-time error

TBR=ahe@google.com

Review-Url: https://codereview.chromium.org/2916773002 .
2017-05-31 16:17:15 -07:00
Paul Berry a122a6409e Add some top level type inference rules for property gets.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2914113002 .
2017-05-31 15:17:16 -07:00
Paul Berry cd5bacbc54 Implement type inference for PropertySet.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2919623002 .
2017-05-31 15:09:28 -07:00
Sigmund Cherem 922326a91f Fix performance regression for checking that retricted types are not
extended/implemented.

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2907333003 .
2017-05-31 14:07:17 -07:00
Sigmund Cherem 682011c7b2 Move enableNative to target, turn it on by default
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2913013003 .
2017-05-31 13:55:55 -07:00
Paul Berry f9c1cab33b Remove some bogus type promotion code.
This code was part of an attempt to prototype some possible extensions
to type promotion to handle `if (x is! Foo)`.  I thought I had
rendered it harmless, but it was having some buggy effects.

Also added a test case demonstrating the problem.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2914093002 .
2017-05-31 13:40:33 -07:00
Paul Berry 26c61e4d22 Implement type inference for PropertyGet.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2921443002 .
2017-05-31 12:26:10 -07:00
Paul Berry 54c57f0015 Remove TODOs from KernelConditionalExpression._inferExpression.
The code is correct as is (at least insofar as it matches analyzer's
behavior).  I've added a new test to verify this, and I've made a
comment on the spec asking for it to be updated to match analyzer's
behavior.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2916633002 .
2017-05-31 10:04:20 -07:00
Konstantin Shcheglov 3803374d32 Don't recreate CoreTypes in transformers. Pass it in.
The same will be done later for ClassHierarchy. So, it would be up to
the client to decide which flavour to create, and whether the same
instance can be reused.

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

Review-Url: https://codereview.chromium.org/2904203003 .
2017-05-31 09:54:27 -07:00
Paul Berry 2b561fe657 Clean up instrumentation of invocation targets.
We should be instrumenting at same the place we set the value of
`interfaceTarget`.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2917663002 .
2017-05-31 09:42:01 -07:00
Peter von der Ahé c0bf4eddbe Various checks for constant expressions.
Fixes https://github.com/dart-lang/sdk/issues/29379

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2911023002 .
2017-05-31 15:57:03 +02:00
Peter von der Ahé 4b47b10a77 Move buildMethodInvocation to BodyBuilder.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2906333002 .
2017-05-31 15:30:54 +02:00
Peter von der Ahé cdfd07b9d3 Don't read platform files during testing, and avoid trimming broken programs.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2912353002 .
2017-05-31 15:03:30 +02:00
Peter von der Ahé 8ea78cbc3f Avoid using Invalid{Statement,Expression,Initializer}.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2906253004 .
2017-05-31 14:53:44 +02:00
Peter von der Ahé 29dac16eba Clean up shared names.
R=johnniwinther@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2909013002 .
2017-05-31 11:08:30 +02:00
Paul Berry b89e8cd1a1 Fix inferInvocation for top level inference.
When inferring the type of an invocation for top level inference, if
type parameters are not specified, then it is an error.  So we should
not recurse into subexpressions (even if inferenceNeeded is `true`).
This avoids confusion by making it clear to the user that we don't
take subexpressions into account when doing top level type inference,
even when recovering from type inference errors.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2911323002 .
2017-05-30 14:43:06 -07:00
danrubel f3a79c4e4e update fasta StringToken.toString to make formatter happy
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2915593004 .
2017-05-30 16:55:08 -04:00
danrubel 427c06c2fe fix fasta scanner adapter lineStarts
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2913043002 .
2017-05-30 16:54:05 -04:00
Paul Berry 0017ffd872 Change the approach of front_end top level inference to match the spec.
Specifically, we can't walk all the subexpressions when doing top
level inference, or we will pick up bogus dependencies.  This means
that we can't determine the dependencies during BodyBuilder execution;
we have to do it in a follow-up pass once we have the AST.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2913743003 .
2017-05-30 13:42:12 -07:00
Konstantin Shcheglov 8460f770b1 Serialize also canonical names of 'interfaceTargetReference'.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2906693002 .
2017-05-30 10:54:14 -07:00
Konstantin Shcheglov 0dd81884bf Perform MixinFullResolution only for source libraries.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2912503003 .
2017-05-30 09:33:26 -07:00
Peter von der Ahé 9497f5d3f8 Remove accessor properties not used by Fasta.
R=johnniwinther@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2908123002 .
2017-05-30 13:08:31 +02:00
Peter von der Ahé 4cd8e437f6 Various constant checks.
R=johnniwinther@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2908113002 .
2017-05-30 12:44:57 +02:00
Paul Berry 6a809aa432 Add type inference logic for "for-in" loops.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2908973002 .
2017-05-29 07:35:46 -07:00
Peter von der Ahé 0eae9218f4 Complain about duplicated names.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2902113005 .
2017-05-29 09:45:05 +02:00
Dan Rubel 767d5ecbfd Revert "improve fasta unterminated string recovery"
This reverts commit 6907345fb9.

Review-Url: https://codereview.chromium.org/2907093002 .
2017-05-28 23:40:08 -04:00
Dan Rubel 6907345fb9 improve fasta unterminated string recovery
* enhance handling of unterminated strings
* update ast builder and string validator to handle unterminated strings

Review-Url: https://codereview.chromium.org/2906193004 .
2017-05-28 23:35:32 -04:00
Paul Berry 9a64339646 Change dependency walker's Node.dependencies to a static getter.
This prevents it from being accidentally overridden in a derived class.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2907023003 .
2017-05-27 21:27:21 -07:00
Paul Berry e4042e5de2 Implement type inference for await expressions in front_end.
This required implementing FutureOr rules in
type_constraint_gatherer.dart.  It also required fixing an incorrect
type in analyzer's mock SDK, which had some follow on effects on
analyzer unit tests.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2904263003 .
2017-05-27 07:30:46 -07:00
Paul Berry 5d69e056d3 Add type inference support for "call" invocations of function expressions.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2911683003 .
2017-05-26 13:34:42 -07:00
Paul Berry d859cc6e4e Add type inference logic for map literals
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2905353002 .
2017-05-26 13:09:53 -07:00