Commit Graph

3034 Commits

Author SHA1 Message Date
Konstantin Shcheglov a94f43334a The parameter of synthetic setters should inherit 'covariant'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28821

Review-Url: https://codereview.chromium.org/2757143002 .
2017-03-20 10:22:52 -07:00
Konstantin Shcheglov a9dfc31525 Infer fields/getters/setters types according to the new top-level inference rules.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28219

Review-Url: https://codereview.chromium.org/2761633002 .
2017-03-19 10:09:48 -07:00
Jennifer Messerly 3aa1be67d9 fix ? incorrectly being used in an implicit instantiation
R=leafp@google.com

Review-Url: https://codereview.chromium.org/2755283002 .
2017-03-17 19:00:25 -07:00
Jennifer Messerly f51ad4cef7 don't produce errors from inference for downward inferred type variables
R=leafp@google.com

Review-Url: https://codereview.chromium.org/2757813002 .
2017-03-17 17:06:05 -07:00
Jennifer Messerly f021a7019b fixes #27586, prefer downwards context type in generic inference
fixes #27625, Object constraints were not tracked in inference
fixes #27933, pin return type from downwards inference

We now prefer to pick the bound (lower or upper) that had some information on, and it also improves inference error messages somewhat (still a ways to go).

The way this works is we now have a type representing an unknown type: ?. We use ? when performing downward inference steps, instead of `dynamic`. This allows more accurate tracking of type constraints.

For example: given:

    var x = await Future.wait([a, b]);

Future.wait<T>'s argument type is Iterable<Future<T>>. Since we didn't know T, we previously pushed down Iterable<Future<dynamic>>. The dynamic caused loss of information. Now we push down Iterable<Future<?>>, allowing us to infer the right type there.

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

Review-Url: https://codereview.chromium.org/2456803004 .
2017-03-17 16:59:56 -07:00
Leaf Petersen e40f878abc Restore weak mode errors on empty returns in Null functions.
Fixes https://github.com/dart-lang/sdk/issues/28668 .

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2752423003 .
2017-03-17 14:30:42 -07:00
Paul Berry 685045d619 Start unraveling circularities between analyzer and front_end/kernel.
This CL moves many of the files from
pkg/front_end/lib/src/fasta/analyzer/ to pkg/analyzer/lib/src/fasta/.
It also moves two files from pkg/kernel/lib/analyzer/ to
pkg/analyzer/lib/src/kernel/.

This reduces the amount of circularity between analyzer and
front_end/kernel so that there are no files in front_end or kernel
which are both dependend upon by analyzer and depend upon analyzer.  I
will clean up the remaining circularities in future CLs.

There should be no functional change.

R=ahe@google.com, asgerf@google.com, kmillikin@google.com, scheglov@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2756593004 .
2017-03-17 05:56:06 -07:00
Jacob Richman a993294503 Format all analyzer packages
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2753923003 .
2017-03-16 16:11:43 -07:00
Konstantin Shcheglov fcfe68f057 Allow AstBuilder to report parse errors.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2752093002 .
2017-03-16 13:52:16 -07:00
Paul Berry ef79634132 Re-land "Add support for metadata on type variables to Fasta parser." (with fixes).
Last time I landed this I left a crucial `pop()` out of BodyBuilder,
resulting in test failures.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2750503012 .
2017-03-15 12:42:23 -07:00
Konstantin Shcheglov ae85bcf954 Parse for-loop statements with Fasta.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2746333005 .
2017-03-15 11:40:32 -07:00
Konstantin Shcheglov 39dbb75c76 Parse constructor field initializers with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2751913002 .
2017-03-15 11:32:53 -07:00
Konstantin Shcheglov 341034718b Parse for-in statements with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747083005 .
2017-03-14 14:19:46 -07:00
Konstantin Shcheglov 9ed77d848e Parse assert statements with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747803004 .
2017-03-14 14:09:23 -07:00
Konstantin Shcheglov 9e3f269d46 Parse break and continue statements with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2748093004 .
2017-03-14 14:03:55 -07:00
Konstantin Shcheglov f873c5657b Parse try-catch statements with Fasta.
There are still failing tests because we cannot access the comma between
the exception and the stack trace parameters. I will make a change
to Analyzer AST to remember commas in parameters, and send another CL
to use it in AST builder.

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

Review-Url: https://codereview.chromium.org/2752543005 .
2017-03-14 13:03:35 -07:00
Konstantin Shcheglov d21cc7750f Parse 'while' and 'do-while' statements with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2748183002 .
2017-03-14 12:57:24 -07:00
Konstantin Shcheglov 9cf7535e03 Parse empty statements with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2753553002 .
2017-03-14 11:35:23 -07:00
Konstantin Shcheglov 3e148a8277 Run statements parsing tests with Fasta.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2745233004 .
2017-03-14 10:24:20 -07:00
Konstantin Shcheglov 08eba174cc Add support for parsing annotations with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2748763003 .
2017-03-14 06:53:35 -07:00
Konstantin Shcheglov e41922501b Create DeclaredSimpleIdentifier when parse a declaration with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2749643002 .
2017-03-13 13:12:57 -07:00
Paul Berry 71304714d4 Revert "Add support for metadata on type variables to Fasta parser."
This caused test failures.  See for example:
https://build.chromium.org/p/client.dart/builders/vm-kernel-linux-release-x64-be/builds/1641

This reverts commit 5d8d01cdf7.

TBR=ahe@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2749623003 .
2017-03-13 12:29:38 -07:00
Konstantin Shcheglov 2a0bd99f8f Fix for parsing named constructors with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2742283003 .
2017-03-13 10:50:02 -07:00
Paul Berry 5d8d01cdf7 Add support for metadata on type variables to Fasta parser.
R=ahe@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2738013002 .
2017-03-13 10:19:22 -07:00
Konstantin Shcheglov e12dc7c2f8 Fix for parsing EmptyFunctionBody with Fasta.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2742233002 .
2017-03-13 09:05:42 -07:00
Lasse R.H. Nielsen 5ae186153c Make Analyzer, VM and dart2js accept URI strings as part-of library identifier.
R=brianwilkerson@google.com, floitsch@google.com, hausner@google.com, johnniwinther@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/ef097edad6e5e4e82c3891ad2d8f9cde8fa8cfdc
Review-Url: https://codereview.chromium.org/2640853005 .
2017-03-13 08:31:40 +01:00
Konstantin Shcheglov 98c52157dc Parse factory constructors with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747583003 .
2017-03-12 09:56:45 -07:00
Brian Wilkerson 8f4a4b7288 Improve recovery in argument lists when missing a comma before a named argument (issue 29005)
R=pquitslund@google.com

Review-Url: https://codereview.chromium.org/2744043002 .
2017-03-11 08:39:40 -08:00
Paul Berry a6ee0dfd3f Add support for documentation comments to most of AstBuilder.
This CL addresses all use cases except for documentation comments on
type parameter formals.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2732363002 .
2017-03-07 14:19:53 -08:00
Konstantin Shcheglov 4a114661a9 Improve primare expression parsing tests.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2733293002 .
2017-03-07 14:01:28 -08:00
Konstantin Shcheglov dc2c7df603 Add 'withKeyword' to mixin application with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2735973004 .
2017-03-07 13:27:50 -08:00
Konstantin Shcheglov ed289f64cd Fix for parsing default parameters.
In analyzer we decide whether to create DefaultFormalParameter by the
fact of being in [] or {}, not by the fact of presence of a default
value.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2740573002 .
2017-03-07 12:20:36 -08:00
Konstantin Shcheglov fe4378d2c8 Fix for parsing generic function types with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2732213003 .
2017-03-07 12:03:55 -08:00
Konstantin Shcheglov 271ea5a551 Parse script tags with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2738693004 .
2017-03-07 11:59:14 -08:00
Konstantin Shcheglov 571aae42b8 Issue 25733. Built-in itentifiers are not permitted as prefixes.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25733

Review-Url: https://codereview.chromium.org/2735193002 .
2017-03-07 10:16:45 -08:00
Konstantin Shcheglov 91cf66ed5d Fix for parsing empty compilation units with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2738693003 .
2017-03-07 09:48:29 -08:00
Konstantin Shcheglov bf4dd380ea Fix for parsing 'rethrow' statement with Fasta.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2730293003 .
2017-03-06 16:50:28 -08:00
Konstantin Shcheglov 262cee7864 Add support for parsing #void with Fasta.
For the reason why we need this, see the following documents.
https://codereview.chromium.org//427603002
https://github.com/dart-lang/sdk/issues/20191
https://github.com/dart-lang/sdk/issues/19972

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

Review-Url: https://codereview.chromium.org/2737593002 .
2017-03-06 11:24:54 -08:00
Konstantin Shcheglov 7c0a0f0f99 Fix tests for parsing literals.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2738453002 .
2017-03-06 11:14:22 -08:00
Konstantin Shcheglov 3e4c4057cd Fix test for parsing 'await'.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2732023002 .
2017-03-06 11:07:11 -08:00
Konstantin Shcheglov 2a60cbf9de Fix for parsing 'const X()' with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2733913002 .
2017-03-06 11:00:32 -08:00
Konstantin Shcheglov 05852a6625 Rename parser tests that use 'type arguments', but named 'type parameters'.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2738433002 .
2017-03-06 10:03:54 -08:00
Konstantin Shcheglov b24ad2e168 Fix for a couple of cascade tests.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2729373004 .
2017-03-06 09:40:02 -08:00
Konstantin Shcheglov 21f8fd8244 Fixes for map literal tests.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2731313002 .
2017-03-06 08:51:12 -08:00
Konstantin Shcheglov be521515fe Parse #operator symbol literals with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2735623002 .
2017-03-06 07:47:46 -08:00
Brian Wilkerson 25989faf83 Support accessing the parameter element when there is no name
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2725013003 .
2017-03-03 08:11:01 -08:00
Konstantin Shcheglov ce58e89d3c Fix parsing [a]sync[*] function body modifiers with Fasta.
The Fasta'a parser is crazy as it is now. It says that something is a
return statement, but it is actually an expression function body. That
seems too much dart2js specific.

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

Review-Url: https://codereview.chromium.org/2728773002 .
2017-03-01 16:20:20 -08:00
Paul Berry 8decc11ac0 Add AstBuilder support for fields.
R=ahe@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2723883002 .
2017-03-01 13:24:17 -08:00
Konstantin Shcheglov 9fa139215b Parse 'x.y' as PrefixedIdentifier, not PropertyAccess with Fasta.
OTOH, 'x?.y' or '(x).y' should be parsed as PropertyAccess.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2722283002 .
2017-03-01 13:12:51 -08:00
Konstantin Shcheglov 86b5a088ad Parse InstanceCreationExpression with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2727753002 .
2017-03-01 13:04:46 -08:00