Commit graph

16738 commits

Author SHA1 Message Date
Johnni Winther ab636dfbd1 Reenable warnings/hints for method type variables in dart2js
Change-Id: I09662afc8b1a4e8c9fdbfe2e342e80ea58351593
Reviewed-on: https://dart-review.googlesource.com/32060
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-01-08 12:48:02 +00:00
Martin Kustermann fa6fa059c4 [Gardening] Mark language_2/assertion_test crash in dartp-debug-strong
Change-Id: I94842673dfc992204a91c1fb456f1861ec5cbc62
Reviewed-on: https://dart-review.googlesource.com/32765
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-01-08 12:25:02 +00:00
Johnni Winther 8e8915f538 Support generic closures in rti analysis
Change-Id: I1d393cff5b83f8db69e7bddb8ecfcd4a5205854f
Reviewed-on: https://dart-review.googlesource.com/32700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 11:36:40 +00:00
Martin Kustermann 3c5211fd93 [Gardening] Remove passing test from status file
Change-Id: Ie465eb85631e875a295e14f10231bda94f86a6ea
Reviewed-on: https://dart-review.googlesource.com/32764
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-01-08 11:18:22 +00:00
Johnni Winther b11cf5e3b5 Support class data in equivalence test
Change-Id: I084af2503ba783de4280f520c5a3000f0b84abe7
Reviewed-on: https://dart-review.googlesource.com/32560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 10:38:55 +00:00
Aske Simon Christensen 0c03458717 Reland "Treat most warnings as errors in strong mode."
Reland of https://dart-review.googlesource.com/c/sdk/+/29160

Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.

A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.

Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.

Closes https://github.com/dart-lang/sdk/issues/31286

Change-Id: Id3b3b7f1fc6a101639fc908c90f3ec7d304a7b4b
Reviewed-on: https://dart-review.googlesource.com/32580
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-08 09:20:02 +00:00
Johnni Winther 966986947b Port inference tests, part #4 of 5
Change-Id: Id4686f1e9673a5c7af3747584c9a59463b770e0f
Reviewed-on: https://dart-review.googlesource.com/32760
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 08:35:56 +00:00
Johnni Winther 00b083bafc Port inference tests, part #3 of ?
Change-Id: Ib4b9650c94b2302f68272d18601c97cd4685e03e
Reviewed-on: https://dart-review.googlesource.com/32543
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 08:28:38 +00:00
Johnni Winther de3f4f5e95 Port inference tests, part #2 of ?
Change-Id: Ia9012f278824ae2a7b069ecdcabc50c7dfbde40d
Reviewed-on: https://dart-review.googlesource.com/32340
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 08:09:44 +00:00
Konstantin Shcheglov e839405b0f Improve compound assignment inference.
Fixes #31484

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

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: I94a571978a4052adca4c85df06941ccf56998bac
Reviewed-on: https://dart-review.googlesource.com/32863
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-08 05:54:53 +00:00
Konstantin Shcheglov a8ebc3115c Use the same rule for inference in expression function bodies as in block bodies.
Bug: https://github.com/dart-lang/sdk/issues/31436
Change-Id: I535c39383d42862f035b54e2fb5c143367605697
     https://github.com/dart-lang/sdk/issues/31638
Reviewed-on: https://dart-review.googlesource.com/32860
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-07 20:46:31 +00:00
Konstantin Shcheglov bbd835f322 Improve for-in statement inference.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: Ie15486387a6b5955e42e9fe5fc00cdba4f2ba68a
     https://github.com/dart-lang/sdk/issues/31440
Reviewed-on: https://dart-review.googlesource.com/32861
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-07 18:57:11 +00:00
Dan Rubel cdd4268bc8 Revert "Improve fasta field recovery"
This reverts commit ab229b30ef.

Reason for revert: Failing co19 test

Original change's description:
> Improve fasta field recovery
> 
> In addition to improving field recovery, this CL
> fixes class field recovery to include an endMember event event
> and cleans up missing class body recovery.
> 
> Change-Id: I53afe5aef55452108803388de9245f7e14f97833
> Reviewed-on: https://dart-review.googlesource.com/32820
> Commit-Queue: Dan Rubel <danrubel@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=brianwilkerson@google.com,danrubel@google.com

Change-Id: Id2976bfe67b410875a912bbfd6bfcbbe3d3c8c75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/32840
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-07 02:06:32 +00:00
Dan Rubel ab229b30ef Improve fasta field recovery
In addition to improving field recovery, this CL
fixes class field recovery to include an endMember event event
and cleans up missing class body recovery.

Change-Id: I53afe5aef55452108803388de9245f7e14f97833
Reviewed-on: https://dart-review.googlesource.com/32820
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-06 21:51:50 +00:00
Konstantin Shcheglov 32e310d8c6 Infer closure parameter types as Object instead of Null.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: If739da50a1d7e21c6a1e18da18d1f85f788663da
     https://github.com/dart-lang/sdk/issues/31546
Reviewed-on: https://dart-review.googlesource.com/32669
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-06 02:31:19 +00:00
Sigmund Cherem 497d592ac7 Fixes for deferred constants in the kernel pipeline.
The constant collector was inconsistent with the old frontend: we were
skipping primitives and we were not going into the body of closures.

Change-Id: I3321426da7e684d203f0ac7a2a2c7028f3138a7b
Reviewed-on: https://dart-review.googlesource.com/32663
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-01-05 23:37:58 +00:00
Harry Terkelsen 11d1b6f0db update status files after switch case fixes
Change-Id: If0127431e9237478ce12ff495d32eff144781bcd
Reviewed-on: https://dart-review.googlesource.com/32670
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2018-01-05 23:29:29 +00:00
Jenny Messerly 0add93f98e fix #31781, fromEnvironment constants in DDK
Change-Id: I5915677204c0b02321e8db6a34e870b6ac63179d
Reviewed-on: https://dart-review.googlesource.com/32681
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-05 22:55:18 +00:00
Brian Wilkerson c151dffb9f Update tests to have an expression rather than a function as the argument in an assert
Change-Id: Ie95b39400adc0acd0b5f2c58dd26d21bb1b8c081
Reviewed-on: https://dart-review.googlesource.com/32502
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-01-05 22:09:09 +00:00
Harry Terkelsen b8b69b1bd9 dart2js-kernel: fix switch with always-throwing method call
Change-Id: I8884207f05ba8cf0a2841f21b1a0e8189ebe14d4
Reviewed-on: https://dart-review.googlesource.com/32662
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-01-05 21:48:28 +00:00
Jenny Messerly 303d71f53f fixes #31575, DDC kernel backend can now compile the SDK to JS
Also adds this to the build script, so we can eventually replace the existing SDK compile step with this new one.

Change-Id: Iba0720df5bbab302d2fdd0b5aeeb182de152cc98
Reviewed-on: https://dart-review.googlesource.com/32504
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-05 21:32:50 +00:00
Johnni Winther 534dcf6874 Register methods depending on the rti need of classes.
Change-Id: I634d78152fc56167b6f32819ffce5d2221da600a
Reviewed-on: https://dart-review.googlesource.com/32320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-05 10:28:00 +00:00
Johnni Winther 4f8682f162 Start computing which generic methods need type arguments
+ rename runtime type concepts

Change-Id: I4d5a73a1327abd62a34c91582ed7a2c9b46a9bc4
Reviewed-on: https://dart-review.googlesource.com/32260
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-05 10:01:14 +00:00
Siva Annamalai ff32e86938 Adjust status files for passing tests.
Bug:
Change-Id: I7bd76bc94a2275d90b852457ad6073559d42478f
Reviewed-on: https://dart-review.googlesource.com/32521
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-05 06:58:30 +00:00
Siva Annamalai 4ba69c4df5 Fixes for some strong mode issues in the isolate tests. Not able to turn
these tests on by default yet because of an issue in the stacktrace
package (see issue 31764)

Change-Id: Ifeb5dc4fc85e7d83b3011948133ce6d2a1998248
Reviewed-on: https://dart-review.googlesource.com/29480
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-01-05 06:19:33 +00:00
Alexander Markov c051a0b905 [VM, Tests] Turn Dart 2.0 fixed-size integers ON by default, v2
Dart 2.0 fixed-size integers are enabled in Dart VM in all modes.
Status of legacy tests is updated.

This CL includes ff9fc413a7 with fixes.

Change-Id: I632d8177e9d07cd82ecea75ab6c325681b3a25c9
Reviewed-on: https://dart-review.googlesource.com/32443
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-05 01:44:56 +00:00
Mike Fairhurst 277274b733 Solve analyzer crash when using a function type in a foreach
Looks like the best place to put this is in the type builder, which has
special logic for foreaches. Previously, that special logic did not
include a need to visit the type, but with [GenericFunctionType]s, its
now necessary.

New test added; fails with kernel.

Bug: 31708
Change-Id: I6536be816a84458cf81d9037289ce6415ed13985
Reviewed-on: https://dart-review.googlesource.com/32447
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-05 00:05:57 +00:00
Paul Berry 879badb850 Implement method type override checking rules in front_end.
Test failures introduced by this change have been marked with issue #31616.

Change-Id: Iddbcedb972b5ad2cf12e3fe588bd38aec76816df
Reviewed-on: https://dart-review.googlesource.com/29742
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-04 22:46:26 +00:00
Alexander Markov 90551f6aa5 Revert "[VM, Tests] Turn Dart 2.0 fixed-size integers ON by default"
This reverts commit ff9fc413a7.

Reason: buildbot failures.
Change-Id: I68ffde271c8ba3b212e3bf015e2e550c8c891441
Reviewed-on: https://dart-review.googlesource.com/32442
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-01-04 19:04:44 +00:00
Alexander Markov ff9fc413a7 [VM, Tests] Turn Dart 2.0 fixed-size integers ON by default
Dart 2.0 fixed-size integers are enabled in Dart VM in all modes.
Status of legacy tests is updated.

Change-Id: I967a413c0b81eb92cf6be78ad3ee324798288bd2
Reviewed-on: https://dart-review.googlesource.com/31406
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-04 18:02:57 +00:00
Aske Simon Christensen 5402f02cbc Revert "Treat most warnings as errors in strong mode."
This reverts commit 3303df8102.

Reason for revert: Tests failing

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

Change-Id: Ifc8c9def6d134ab1b0c5f094a02a4f57a3581f19
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/32360
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-01-04 15:35:17 +00:00
Aske Simon Christensen 3303df8102 Treat most warnings as errors in strong mode.
Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.

A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.

Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.

Closes https://github.com/dart-lang/sdk/issues/31286

Change-Id: I6acea31b8cba7dec8b318e081d28f4eb4ebbf75c
Reviewed-on: https://dart-review.googlesource.com/29160
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-04 14:56:46 +00:00
Dmitry Stefantsov 1f3b493dcc Add simple instantiate-to-bounds algorithm to the common front-end
Bug:
Change-Id: I65097b037f4b02f0a161c9c183844a3dc3339c77
Reviewed-on: https://dart-review.googlesource.com/29880
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-04 11:31:08 +00:00
Kevin Millikin 6fa813d818 Change handling of Kernel static errors
Before: Kernel static errors were represented by throwing a distinguished
error or else by calling a distinguished library const constructor.

Now: Kernel static errors are represented by InvalidExpression.  To support
error reporting, InvalidExpression has an optional message and a file
offset.  A back end can choose to signal these errors at any time; for
example, when deserializing the binary, or when compiling the procedure
containing the static error, or when the erroneous expression is evaluated
at run time.

InvalidStatement is removed because it can be encoded as ExpressionStatement
of InvalidExpression.

Future work:

* supporting static errors where an expression cannot appear in the AST
* allowing InvalidExpression to contain an Expression for error recovery
* adding a top-level list of static errors and warnings to the binary

Bug: https://github.com/dart-lang/sdk/issues/29840
Change-Id: Ifdfe9a76cee6cefed28061bf245be70531d2f413
Reviewed-on: https://dart-review.googlesource.com/31320
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-04 11:00:25 +00:00
Johnni Winther 985eba5139 Refactor RuntimeTypesNeed(Builder) and make them testable
Change-Id: I67234dd2b076327c138e5b1d7de47ee3edc987d1
Reviewed-on: https://dart-review.googlesource.com/31901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-04 08:35:31 +00:00
Sigmund Cherem 747772b02d Add regression test for #31306
I ended up fixing this bug during my refactoring to support
deferred-constant-values in kernel (1ddb7db237).
The issue was that ssa/builder.dart was using the output unit of the deferred
import instead of the output unit of the deferred constant field.

(fixes #31306)
Bug: https://github.com/dart-lang/sdk/issues/31306
Change-Id: I557983c5ec85f2aa6adb486961dd2f79852e8d5a
Reviewed-on: https://dart-review.googlesource.com/32201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-04 00:16:25 +00:00
Régis Crelier 2e3a4f8723 [VM] Ignore flag --error-on-bad-override in strong mode (fixes #31646).
Change-Id: Idabd0108a69b37a9181c6bb260a25b3ebae2ba63
Reviewed-on: https://dart-review.googlesource.com/32003
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-01-03 15:40:36 +00:00
Lasse R.H. Nielsen d1382f983c Initial steps to add cast operation.
Start by adding static castTo method to the interfaces. This provides everybody with the
desired implementation without exposing the classes.
When implementing the cast method, the recommended way is to (extend the base class,
but if you choose not to ...) use the castTo method.

If we ever get a language feature, we can implement the castTo method using that,
without being stuck with an unnecessary class.

Change-Id: I53274e60c88a4de519bead85d2ca44c1065a9c1a
Reviewed-on: https://dart-review.googlesource.com/26620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-03 12:16:24 +00:00
Johnni Winther 47d4534700 Port inference tests, part #1 of ?
- to the equivalence framework.

Change-Id: Ieddcb60c5e5367e2554bfa715562264f1dca5a9e
Reviewed-on: https://dart-review.googlesource.com/31941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-03 08:57:37 +00:00
Johnni Winther 940f82bb8b Port unittests, #14 of ?
Change-Id: I6a16cf3cbaeafa2f4c58d617b1d6df9aefcc4afd
Reviewed-on: https://dart-review.googlesource.com/31781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-03 08:37:09 +00:00
Johnni Winther ca31d3e341 Handle inlining of static generic method calls.
Change-Id: I8531fd72589da0b823e59087361e4ff31b7be8cf
Reviewed-on: https://dart-review.googlesource.com/31786
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-03 08:36:35 +00:00
Johnni Winther e9243a4d16 Pass type arguments in static calls.
+ support generic type variable type literals
+ support generic type variable is test

Change-Id: I2473c39c33940c631070b919c7dcfe712fd1fe3d
Reviewed-on: https://dart-review.googlesource.com/31783
Reviewed-by: Stephen Adams <sra@google.com>
2018-01-03 07:57:58 +00:00
Paul Berry 15c684bf50 Disable implicit instantiation of call methods.
Addresses the performance concern raised in #31746

Change-Id: Iabfb4b871fb7807c0fe625036adfd22d2e6c51ee
Reviewed-on: https://dart-review.googlesource.com/31751
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-02 23:15:33 +00:00
Johnni Winther 220a91122a Add --strong-mode flag to dart2js
+ move generic methods tests into a subfolder.

Change-Id: I00cde6a7dc7d6ff1677a8ca60f3a243f065e3765
Reviewed-on: https://dart-review.googlesource.com/31782
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-02 08:42:21 +00:00
Terry Lucas 476b1e02a9 Updated PYTHON code to correctly generate web_sql and re-wrote/re-enabled async web_sql test.
Also, updated status files to correctly fix failures in FF, IE and removed other spurious status entries.

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

Change-Id: Ic965103d892ff4d5d119712e3187e829f57cd022
Reviewed-on: https://dart-review.googlesource.com/31800
Reviewed-by: Terry Lucas <terry@google.com>
2017-12-29 23:51:02 +00:00
Johnni Winther 68e39ed6dc Split value_range_test and mark load_elimination_test as slow
Change-Id: I0becd6ddc9edd758f119436ec5ed6cdbde3c6359
Reviewed-on: https://dart-review.googlesource.com/31785
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-29 21:30:39 +00:00
Johnni Winther c536cb4b9a Mark no_such_method_enabled_test as slow
Change-Id: I50f335fe3c0a4d323f6e0ac6577be911913386cf
Reviewed-on: https://dart-review.googlesource.com/31780
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-29 14:59:35 +00:00
Johnni Winther e6d4ee1cc4 Move unittests, part #13 of 13
Change-Id: I0001b681892a5f025339ef4822191a1c72b8ec83
Reviewed-on: https://dart-review.googlesource.com/31487
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 13:31:52 +00:00
Johnni Winther 2d31bdecee Port unittests, part #13 of ?
Change-Id: Ibfe12082d12b4baafc7c4ffd5fe390d2ff33cac9
Reviewed-on: https://dart-review.googlesource.com/31486
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 13:15:21 +00:00
Johnni Winther 50c0c38a60 Move unittests, #12 of ?
Change-Id: I218d69ecdefc7580ab192eb1aa36a0f000427c92
Reviewed-on: https://dart-review.googlesource.com/31485
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 13:02:07 +00:00