Commit Graph

1972 Commits

Author SHA1 Message Date
Paul Berry e8091b27b1 Implement "unknown getter/setter/method" compile time errors in the front end.
Fixes #21938 (Front end does not warn on function calls on Object).

A small number of tests begin failing with this change--these tests
have been marked with issue #31533 for later triage.

Change-Id: I3a956410a6780772fe90098d8604fb10718504df
Reviewed-on: https://dart-review.googlesource.com/26045
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-05 00:14:54 +00:00
danrubel 9dbaa323e0 fix AstBuilder missing method body recovery
Change-Id: I875cfb2dbe96f12fd1369a7176cf575afa0d2bd5
Reviewed-on: https://dart-review.googlesource.com/26060
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-04 23:18:24 +00:00
Dan Rubel 2a883a9c33 More fasta parser expression recovery
Change-Id: Ie3a71d4febcb9e0c277ddd6038eb1cc40c6fdf26
Reviewed-on: https://dart-review.googlesource.com/24240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-04 16:22:04 +00:00
Paul Berry c800a1cc29 Fix error recovery for invalid assignment.
Previously, the front end recovered from an invalid assignment by
producing an "as" expression, e.g.:

    int x;
    String y;
    x = y;

Would produce an "invalid assignment" error, as well as this kernel
code:

    int x;
    String y;
    x = y as{TypeError} int;

The rationale was that the "as" check was guaranteed to fail, so this
code would produce a runtime error at the correct location.  However,
there were two problems:

1. (Minor problem) the "as" doesn't actually fail if the RHS is null.

2. (Major problem) for type inference, the type of an assignment
expression is defined to be the type of the RHS.  This means that if
the invalid assignment gets used for type inference, we generate
mal-typed kernel code, e.g.:

    int x;
    String y;
    var z = (x = y);

Gets compiled to:

    int x;
    String y;
    String z = (x = y as{TypeError} int);

This CL addresses both problems by changing the kernel representation
so that it evaluates the RHS and then throws an exception.  Since a
"throw" expression has type Bottom, the kernel representation is
guaranteed to be properly typed.  This also ensures that an exception
gets thrown if the RHS is null.  Finally, as a side bonus, it makes
the error-recovered kernel code more similar to the kernel code we
generate in other error recovery scenarios.

Change-Id: Iac74e0c726ce029ac0560d271413e85c15bfec5c
Reviewed-on: https://dart-review.googlesource.com/24140
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-04 14:38:04 +00:00
Peter von der Ahé f8380b0124 Test full compile using minimal IKG
Change-Id: I2e754113ab64a60d3ee1740fcb86adaf92f247d9
Reviewed-on: https://dart-review.googlesource.com/24421
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-12-04 14:30:34 +00:00
Dmitry Stefantsov 7340057cf8 [kernel] Clean up RedirectingFactoryConstructor class
Also, use more descriptive "redirecting_factory" instead of "factory"
in the textual representation of RedirectingFactoryConstructors.

Bug:
Change-Id: Ib01e21107b86e55a10721dde551e802ef3230c80
Reviewed-on: https://dart-review.googlesource.com/24400
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2017-12-04 13:07:34 +00:00
Peter von der Ahé e14726a3f4 Use absolute URIs instead of relative paths
We change the type of FileUriNode.fileUri from String to Uri, which in principle
doesn't change the binary format. However, we did notice that LibraryParts
weren't serialized as specified in binary.md, so we also fixed that.

Since fileUris are stored as strings in a separate table, Uri.parse is only called
once per unique URI.

Fasta only uses relativizeUri when printing diagnostics, and URIs stored in
expectation files (golden files) are relativized using String.replaceAll.

Change-Id: Ib2dc1b80c03a0cdaf84e48b8b3ba73b16bdf8a40
Reviewed-on: https://dart-review.googlesource.com/25421
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-04 11:34:24 +00:00
Samir Jindel bf797e6507 [kernel] Re-land assert initializers.
This change updates Dart2js and DDC.
Thanks to johnniwinther@ for the Dart2js updates.

The original revision is in patchset 2.

Change-Id: I26db33312f003f88ccccb67b27998ef21a1f667f
Reviewed-on: https://dart-review.googlesource.com/25820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2017-12-04 11:22:34 +00:00
Konstantin Shcheglov 21277a4df8 Apply resolution to 'this' and 'super'.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I905ea53aa1c39d789824e8c7061135a41b8f8cac
Reviewed-on: https://dart-review.googlesource.com/25663
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-03 00:13:42 +00:00
Konstantin Shcheglov 2804d6db9b Apply resolution to null-aware local variable assignment.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ib7e4621169063b433ec9f52b7f293d909e3cae20
Reviewed-on: https://dart-review.googlesource.com/25509
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-12-02 03:55:53 +00:00
Paul Berry 1ff1efaf47 Fix ast_builder.status
This should fix a breakage in buildbots such as
https://build.chromium.org/p/client.dart/builders/vm-kernel-linux-release-x64-be
Change-Id: Idcdcdf841bab60b83675872a2ece385e2f4fd3b7
Reviewed-on: https://dart-review.googlesource.com/25513
Reviewed-by: Paul Berry <paulberry@google.com>
2017-12-01 23:46:46 +00:00
Paul Berry 7d65fec76e Reland "Route all messages through Loader."
This is the same as https://dart-review.googlesource.com/24481, but
with additional status file fixes.

Change-Id: Ic076c4dbf9c07e0fdf316298ca1ee1b6ce25002b
Reviewed-on: https://dart-review.googlesource.com/25508
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-01 22:47:06 +00:00
Konstantin Shcheglov 4740885c5a Apply resolution to ConditionalExpression.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I26bfba9d1e03fac01fbc84911de740b3c1435e6c
Reviewed-on: https://dart-review.googlesource.com/25683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-01 22:39:12 +00:00
Ryan Macnak a646f51a5b Revert "Route all messages through Loader."
This reverts commit 8e4b0bda23.

Reason for revert: Failures on most kernel bots

Original change's description:
> Route all messages through Loader.
> 
> This ensures that all messages are passed to instrumentation.
> 
> Issues addressed in this CL:
> 
> * When I added addCompileTimeError, I forgot to remove addError.
> 
> * All messages now all arrive in a single location (Loader). SourceLoader adds instrumentation by overriding recordMessage.
> 
> * As I changed the type inferrer to use addCompileTimeError, I broke DDC. This is because the front_end API (generateKernelInternal in kernel_generator_impl.dart) returns null if there are any errors reported via addCompileTimeError (and this didn't happen with addError, that shouldn't have been there anyways).
> 
> * Due to the previous problem, I changed generateKernelInternal to ignore errors, but then I started getting missing compile-time errors. This turned out to be due to the the silent parameter used during outline- and diet-parsing.
> 
> * I've removed all the "silent" parameters. This didn't work reliably and have been confusing Brian, Dan, and me several times when making parser changes. Instead we detect duplicated messages and avoid reporting them more than once.
> 
> * Types in error messages got names that where using a global object (globalDebuggingNames in pkg/kernel/lib/text/ast_to_text.dart). This meant that the #lib prefix would vary depending on how many tests were run which affected the serialized error message in pkg/front_end/testcases/invalid_assignment.dart.strong.expect.
> 
> Change-Id: I3d89372d6593a6e7e50cce733f61eedb881e15ed
> Reviewed-on: https://dart-review.googlesource.com/24481
> Commit-Queue: Peter von der Ahé <ahe@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>
> Reviewed-by: Kevin Millikin <kmillikin@google.com>

TBR=paulberry@google.com,ahe@google.com,kmillikin@google.com

Change-Id: I9f7b345a8ff040fc7aa73c5cb605190e47fd284b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/25660
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-01 20:37:45 +00:00
Konstantin Shcheglov e16df981c9 When applying types, treat UndefinedType as having required number of UndefinedType arguments.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Id2428967928a823cb55dcc4348b994af5c6674bf
Reviewed-on: https://dart-review.googlesource.com/25502
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-01 19:10:17 +00:00
Samir Jindel 48a927acb2 Revert "[kernel] Introduce assert initializers."
Reverting due to several test failures.

This reverts commit 67adfe741b.

Bug:
Change-Id: Idd1aa15d47df68f2938285468dfa3d5043d8dae2
Reviewed-on: https://dart-review.googlesource.com/25520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-01 17:46:05 +00:00
Konstantin Shcheglov 22f5ce415d Translate types during ResolutionApplier.
This allows us update enclosing ExecutableElement as we enter/exit
local functions, and successfully translate references to type
parameters.

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

Bug:
Change-Id: I184123212b816740a586beee98796c28beadf6b2
Reviewed-on: https://dart-review.googlesource.com/25220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-01 16:58:47 +00:00
Paul Berry ef25e491a2 Improve type inference for for-in statements.
Fixes #31440.

There is a minor change outside of type inference: the body builder
now stores the synthetic assignment (used for for-in loops that don't
declare their own variable) in ShadowForInStatement so that type
inference doesn't have to dig through the desugared kernel objects in
order to find it.

Change-Id: I6520695336560883e2aa07bb110378b7846c2e11
Reviewed-on: https://dart-review.googlesource.com/25040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-01 16:53:47 +00:00
Kevin Millikin e1bf9c3e88 Remove void as an exported name from dart:core
`void` will be a reserved word in Dart 2.0 (it always was in Dart 1.x).
Remove it as an exported name from dart:core because it could be
accidentally hidden.

Bug: https://github.com/dart-lang/sdk/issues/31480
Change-Id: Id804cccbc144f3c8ba2fc9898a3b5c79e238ab36
Reviewed-on: https://dart-review.googlesource.com/24940
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-12-01 16:28:16 +00:00
Samir Jindel 67adfe741b [kernel] Introduce assert initializers.
Assert initializers in Dart may be compiled directly to this form of initializer,
rather than through local initializers as is done now.

Bug:
Change-Id: Ia149ea3d1df5d1dc18be5636801604ffaf7ca7d8
Reviewed-on: https://dart-review.googlesource.com/14760
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-01 14:04:06 +00:00
Peter von der Ahé 632bba54b9 Start building incremental test suite
Change-Id: I38e969e494c671982ec2cba96d2657a836dd0d49
Reviewed-on: https://dart-review.googlesource.com/24122
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-01 13:03:16 +00:00
Peter von der Ahé 8e4b0bda23 Route all messages through Loader.
This ensures that all messages are passed to instrumentation.

Issues addressed in this CL:

* When I added addCompileTimeError, I forgot to remove addError.

* All messages now all arrive in a single location (Loader). SourceLoader adds instrumentation by overriding recordMessage.

* As I changed the type inferrer to use addCompileTimeError, I broke DDC. This is because the front_end API (generateKernelInternal in kernel_generator_impl.dart) returns null if there are any errors reported via addCompileTimeError (and this didn't happen with addError, that shouldn't have been there anyways).

* Due to the previous problem, I changed generateKernelInternal to ignore errors, but then I started getting missing compile-time errors. This turned out to be due to the the silent parameter used during outline- and diet-parsing.

* I've removed all the "silent" parameters. This didn't work reliably and have been confusing Brian, Dan, and me several times when making parser changes. Instead we detect duplicated messages and avoid reporting them more than once.

* Types in error messages got names that where using a global object (globalDebuggingNames in pkg/kernel/lib/text/ast_to_text.dart). This meant that the #lib prefix would vary depending on how many tests were run which affected the serialized error message in pkg/front_end/testcases/invalid_assignment.dart.strong.expect.

Change-Id: I3d89372d6593a6e7e50cce733f61eedb881e15ed
Reviewed-on: https://dart-review.googlesource.com/24481
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-01 11:38:26 +00:00
Brian Wilkerson 18b9fd95c9 Recover from missing semicolon when skipping a function body
Change-Id: I1645317fc0707bb1e61550031eae680fb602089d
Reviewed-on: https://dart-review.googlesource.com/24280
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-30 17:56:04 +00:00
Brian Wilkerson e98519a5c9 Gardening: Update ast_builder status file (TBR)
Change-Id: I51b94d71d898c10592fc733109a7c6636a1ac50e
Reviewed-on: https://dart-review.googlesource.com/24702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-11-30 00:55:50 +00:00
Konstantin Shcheglov 87fba233dd Apply resolution to AsExpression.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I47ccdcd837cee613076a3ce23cdab3f91abb17b1
Reviewed-on: https://dart-review.googlesource.com/24641
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 23:32:31 +00:00
Konstantin Shcheglov 5dc85f380d Apply resolution to IsExpression.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I9919645507e7ba699b9ed2944613d8a69e815560
Reviewed-on: https://dart-review.googlesource.com/24625
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 23:05:40 +00:00
Konstantin Shcheglov 21d3790b48 Skip the type of synthetic Not in a != b.
R=brianwilkerson@google.com

Bug:
Change-Id: I9beacc690aafd9a0367934800ae472dfe4fc5b9a
Reviewed-on: https://dart-review.googlesource.com/24503
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 22:25:30 +00:00
Paul Berry 327adac235 Insert implicit downcasts for function expressions.
Note that there are currently some inconsistencies between how
function expressions are inferred depending whether they are defined
using `{}` or `=>` (see issue #31436).  This CL preserves the existing
inconsistencies.  Once we decide how we want to resolve issue #31436,
I'll revisit this code to ensure that it is still correct.

Change-Id: I3926a4b3dc51155d8f03adaae380b50aab39ca60
Reviewed-on: https://dart-review.googlesource.com/24622
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-29 22:24:31 +00:00
Konstantin Shcheglov 8fd8819748 Support for local variables/parameters of nested local functions.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Iec6b55c93467e77fb9077b21cd07668c9283b05b
Reviewed-on: https://dart-review.googlesource.com/24600
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 21:47:15 +00:00
Konstantin Shcheglov b0ace18fbb Apply resolution to PrefixExpression.
Not test for `!`, I will get back to the previous CL once this lands.

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

Bug:
Change-Id: I4d5d107e3f3544b1daae8ed4327a1c165467f589
Reviewed-on: https://dart-review.googlesource.com/24505
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 20:17:30 +00:00
Paul Berry d358897ab2 Insert implicit downcasts for for-in loops.
Note that this CL makes a minor change outside of type inference: it
changes the BodyBuilder so that when it desugars a for-in loop that
assigns to a variable declared elsewhere, the desugared assignment is
expressed using shadow objects; this is necessary to ensure that the
type inference engine can walk the desugared assignment and insert an
implicit downcast if necessary.

Change-Id: I4d87f83b8a4b3b72e7ba8042ccd711f0d012fac0
Reviewed-on: https://dart-review.googlesource.com/24340
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 19:20:31 +00:00
Konstantin Shcheglov 3b3537a35c Skip empty strings while applying resolution to StringInterpolation.
This is not related to the failing VM test as far I see.

R=brianwilkerson@google.com

Bug:
Change-Id: Id5799b4b55e75da021c64a949d4084c44689a175
Reviewed-on: https://dart-review.googlesource.com/24502
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 19:20:11 +00:00
Konstantin Shcheglov fe3de034fb Apply resolution to PrefixExpression.
R=brianwilkerson@google.com

Bug:
Change-Id: Ib8bfac731751ede8ce1c34e1457b13505148d344
Reviewed-on: https://dart-review.googlesource.com/24360
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 15:01:01 +00:00
Peter von der Ahé fabd675b4e Convert Dartino tests to individual files.
Change-Id: I0e3d637a43ba3d71a71fa1b7a3e2162c247abf49
Reviewed-on: https://dart-review.googlesource.com/24111
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-11-29 10:37:01 +00:00
Peter von der Ahé 7e8666daf5 Move documentation to README.md
Change-Id: I20613a98e25d32aede47ca14a879387af30d0fd4
Reviewed-on: https://dart-review.googlesource.com/24108
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-11-29 10:09:33 +00:00
Konstantin Shcheglov 69d1301388 Apply resolution for IndexExpression, read/write.
This also changes the order of information for invocations:
1. Target / receiver.
2. Reference to the procedure.
3. The actual type of the procedure.
4. The type of the returned result.
5. Arguments.

  This makes reading and assigning by index consistent.

  Unfortunately we need to provide the offset associate with the
defered returned result in methodInvocationBeforeArgs(), where we
don't have access to Arguments yet. So, I have to implement replacing
offsets with _replaceType().

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

Bug:
Change-Id: Ib86c57efce8fa194b11a6979633243054c8ab7c9
Reviewed-on: https://dart-review.googlesource.com/24221
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 00:31:49 +00:00
Paul Berry 2b567c53d4 Insert implicit downcasts for parameter default values.
No language_2 tests are added to validate this behavior yet, because
we are still deciding what we want the semantics to be.  I will follow
up with language_2 tests once the semantics have been decided upon.

Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: Ia24c9789220d09682b4b3ade9374d279ff2a4b6e
Reviewed-on: https://dart-review.googlesource.com/24320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-29 00:00:09 +00:00
Brian Wilkerson 20c9565b3d Recover from a missing function body
Change-Id: Ie9091f856fdff2e2fceaa34cd29ce787f092b6e0
Reviewed-on: https://dart-review.googlesource.com/24160
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-11-28 19:11:44 +00:00
Dmitry Stefantsov ccbeebe2a6 [kernel] Add new member kind for redirecting factory constructors
New type of AST nodes RedirectingFactoryConstructor is added to Kernel.
The goal is to keep the information about redirecting factory
constructors in the class for the linking phase.

Change-Id: I7477c617fa7fd4935ceb23098ec7c056d1f286ca
Reviewed-on: https://dart-review.googlesource.com/14740
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-11-28 17:36:44 +00:00
Konstantin Shcheglov 0599ed3e90 Apply resolution for simple (not compound) assignments.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Icc3ae14f30b23dd6e092f7a9e067f98248d681ea
Reviewed-on: https://dart-review.googlesource.com/24080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-28 17:08:25 +00:00
Peter von der Ahé e9ed7b09d2 Import incremental tests from Dartino
This file is copied verbatim from https://github.com/dartino/sdk/blob/fa9ec675c51947f8b974a689214fe50abcfa5d6b/tests/dartino_compiler/incremental/tests_with_expectations.dart

My plan is to convert these tests to individual YAML files,
as I think YAML files are easier to manage than Dart constants.

Change-Id: Icaa923d99ed1308c2c3efba4ea74a298eba5ad51
Reviewed-on: https://dart-review.googlesource.com/24107
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-28 11:36:29 +00:00
Paul Berry a36da30529 Insert implicit downcasts for indexed assignments.
Change-Id: Ic6b5732100908fe6ce5abfc8c577e9f5ad8245b7
Reviewed-on: https://dart-review.googlesource.com/24021
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-28 01:28:06 +00:00
Konstantin Shcheglov 1f9b27771c Apply resolution for BinaryExpression.
I changed the offset the resulting type for invocations. If there are
arguments (usually there are) we record with the offset of `(`. If there
are no arguments (binary operator), we record with the fileOffset of
the invocation, which is then the offset of the operator.

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

Bug:
Change-Id: Ib5b531440e0782a00764ad68c20e2f1d52ff92d0
Reviewed-on: https://dart-review.googlesource.com/24020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-27 22:10:41 +00:00
Konstantin Shcheglov aaece788b5 Skip implicit Null type for absent default value of optional formal parameters.
This CL also makes following changes to front-end:

1. We report inference for default values of formal parameters before body for
both local and non-local functions.

2. We set NullLiteral for missing default values of formal parameters of
local functions, and perform inference for them, as it is done for non-local
functions.

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

Bug:
Change-Id: I8acdbce9e1ff1477ab52d9382a631932db9eb3f3
Reviewed-on: https://dart-review.googlesource.com/23940
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-11-27 20:25:01 +00:00
Paul Berry 0eefa06d14 Insert implicit downcasts for the conditions of while statements.
Change-Id: Ieb1bc13de5afb16e75ab810de35002bb3b966ea8
Reviewed-on: https://dart-review.googlesource.com/23742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-27 17:07:41 +00:00
Konstantin Shcheglov cf4db2be5e Apply resolution to InstanceCreationExpression.
R=brianwilkerson@google.com

Bug:
Change-Id: I213f58fd8c71eb9933c13f696f6d1a407f4553bb
Reviewed-on: https://dart-review.googlesource.com/23727
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-11-27 03:00:51 +00:00
Paul Berry b47ef6bdeb Insert implicit downcasts for the conditions of assert statements.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: Ife1531ee029dda32e91f7aa0d5720353de7996d5
Reviewed-on: https://dart-review.googlesource.com/23726
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-26 17:06:00 +00:00
Paul Berry 419a8c342e Insert implicit downcasts for field initializers.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I0ea8fcf94728e70d92f4be771f3ca5d10c366375
Reviewed-on: https://dart-review.googlesource.com/23725
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-26 06:33:50 +00:00
Brian Wilkerson 042af775af Apply some element data, improve handling of generic function types, improve tests
Change-Id: I501a5273834cc2f7f73465377bf145da183cd207
Reviewed-on: https://dart-review.googlesource.com/23241
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-24 15:44:09 +00:00
Paul Berry 5ce5811216 Insert implicit downcasts for the conditions of for statements.
Change-Id: I213617cb4ea1a5c29f8a6a56f54792c59cc4e132
Reviewed-on: https://dart-review.googlesource.com/23221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-23 16:47:32 +00:00