Commit Graph

533 Commits

Author SHA1 Message Date
Erik Corry d58b0e2d44 [VM] Mark bigint test slow after small Smi change
R=kustermann@google.com

Change-Id: I553c364be1ce2a29306f44f3a641441cdcb911ca
Reviewed-on: https://dart-review.googlesource.com/50223
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-04-09 15:23:32 +00:00
Stephen Adams 6656233fcc Strong-mode fixes in js_runtime
Fixes errors in RegExp and String.fromCharCodes.

TBR=sigmund@google.com

Change-Id: I7f84d2b9ee2dfead6d0cf634e36c06b9071bf991
Reviewed-on: https://dart-review.googlesource.com/49981
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-06 21:44:32 +00:00
Jenny Messerly bed5debbeb Callable object support in Analyzer and DDC.
Fixes #32156
Fixes #32157
Fixes #32426

This also fixes `implements Function` so it has no effect in Dart 2
(it is ignored for the purposes of subtyping.)

Change-Id: Ibec9c77cd516b8b97fef68a579998598d0acf8c6
Reviewed-on: https://dart-review.googlesource.com/45141
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-30 18:14:55 +00:00
Sigmund Cherem 8d689fcca7 step 4 of ??: add omit-implicit-checks and preview-dart-2 flags, strong-mode
defaults to include implicit checks.

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

Change-Id: Iad5311234dec50a3f8dbd6557264b3feeb92afc8
Reviewed-on: https://dart-review.googlesource.com/48459
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-29 22:13:09 +00:00
Sam Rawlins 301b5a1f16 Remove Maps; move _fillMapWith* methods to MapBase
Fixes #31843

Bug: https://github.com/dart-lang/sdk/issues/31843
Change-Id: I02c544c921951f4a50421205dc1f25997cbecd6e
Reviewed-on: https://dart-review.googlesource.com/39880
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-03-26 21:23:21 +00:00
Johnni Winther 5271cc4e81 Support FutureOr at runtime
Change-Id: I6d442ac160739490c2591367055aaa0ba0c00047
Reviewed-on: https://dart-review.googlesource.com/48143
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-26 12:54:58 +00:00
Emily Fortuna f0b1485aa6 Update test status with added test for generic method apply function.
TBR=sra

Change-Id: I5f9d829e805bbced29299463c1ebdd0dc87b972c
Reviewed-on: https://dart-review.googlesource.com/48320
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-03-24 00:24:24 +00:00
Emily Fortuna 239bb84f71 Added test for function.apply with generic functions.
Change-Id: I759fdc435f3200005760296ffb5289f195c6cf0d
Reviewed-on: https://dart-review.googlesource.com/48261
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-03-23 23:33:29 +00:00
Alexander Aprelev a1ce8cb420 Update corelib_2/bigint_from_test status.
Bug: https://github.com/dart-lang/sdk/issues/32619
Change-Id: I81bde9c9121ff4f47821d3fb6ee34520bb767e92
Reviewed-on: https://dart-review.googlesource.com/48087
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-03-23 20:06:20 +00:00
Régis Crelier f2806ab624 [Corelib, VM runtime] Fix handling of zero operand in Bigint operations (fixes #32465).
Fix VM, dart2js, and dcc Bigint implementations.
Add shift tests.
Re-enable Bigint intrinsics on VM.

Change-Id: Iec19eac8069cf17783a5346289ea2745ffcc7c26
Reviewed-on: https://dart-review.googlesource.com/46570
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-21 21:44:10 +00:00
Johnni Winther 1fc73bf1a6 Compute ClassFunctionType from signature function in Dart 2
- and reinsert assertion.

Change-Id: I2edd119dc53c46e764c07d095213183a186d9a22
Reviewed-on: https://dart-review.googlesource.com/47042
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-03-21 10:48:39 +00:00
Zach Anderson 38dc57504b [status] Update corelib_2 status for bigint test
related #32619

Change-Id: Iee23ea5d80f398e7a25b4c77164f327c4cf064ab
Reviewed-on: https://dart-review.googlesource.com/47401
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-03-20 23:53:39 +00:00
Lasse Reichstein Holst Nielsen a81bc639b5 Fix bug in BigInt.from with certain double values.
Add test.

Change-Id: I385f7237e1b3d004b4401e18a82919b15d097181
Reviewed-on: https://dart-review.googlesource.com/46460
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2018-03-19 17:46:35 +00:00
Lasse Reichstein Holst Nielsen c43b1d66b5 Fix typo in map.update.
Add tests.

Change-Id: If27b6c987c944ebb84d43acde012f5b44730c4e7
Reviewed-on: https://dart-review.googlesource.com/45501
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-03-19 10:54:15 +00:00
Emily Fortuna db21add40c Adding test for async closures with type variables, and fixing how we emit stubs
with type parameters in the meanwhile.

Change-Id: I5fe1e94e7423af30adf4020b46269b8ea81ac07f
Reviewed-on: https://dart-review.googlesource.com/46700
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-16 17:46:18 +00:00
Lasse R.H. Nielsen 6f13072739 Add toString to MapEntry.
Fixes #32464

BUG: http://dartbug.com/32464

Change-Id: I1462452c3f6a7838aeaaa84e3fb0e092a3f85338
Reviewed-on: https://dart-review.googlesource.com/45704
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2018-03-13 13:57:59 +00:00
Lasse R.H. Nielsen 00dae36b47 Add of constructors to collections.
Change-Id: Ic9a180cbb758cf8fe51369d904fa4b51fd1b8e27
Reviewed-on: https://dart-review.googlesource.com/44480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-03-13 12:57:49 +00:00
Stephen Adams b93c74092a Make isInterceptedCall a field
Change-Id: I88a16189d8a6a30fa52be61bc3d015a703368baa
Reviewed-on: https://dart-review.googlesource.com/45583
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-08 23:50:57 +00:00
Leaf Petersen 4c881188b2 Disable the .whereType method until generic methods are turned on.
The whereType method silently does the wrong thing without methods,
so make it throw until we turn them on everywhere.

Change-Id: Id934c8bdb4f682dbc3560d78fbca580e37297e2d
Reviewed-on: https://dart-review.googlesource.com/45744
Reviewed-by: Nate Bosch <nbosch@google.com>
2018-03-08 23:14:22 +00:00
Lasse Reichstein Holst Nielsen b3c12d4e3a Dart 2 Libraries Wave 3
Add `typeArguments` to Invocation.
Add constructors to Invocation, making it less necessary for users to create their own implementations.
Add tests.
Add Symbol.unaryMinus and Symbol.empty constants.

Change-Id: I70cb3265f9413617cf57fce1297e393a29eeb26a
Reviewed-on: https://dart-review.googlesource.com/40741
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-03-08 16:36:07 +00:00
Emily Fortuna 24507da9da Fix stack overflow when analyzing type variables in generic methods.
Change-Id: Id182bb5f0511911662c1a758fce7792c686538c4
Reviewed-on: https://dart-review.googlesource.com/45560
Reviewed-by: Stephen Adams <sra@google.com>
2018-03-07 22:49:11 +00:00
Johnni Winther 8f4db274f1 Compute which selectors that need type arguments
Change-Id: I0e48ff67353d676ea77d13008ae46f79bb69336e
Reviewed-on: https://dart-review.googlesource.com/45321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-07 13:46:49 +00:00
Johnni Winther 8831dd1308 Remove failing assertion
Change-Id: Idfc2656460e2e6e63948172d63f90585be65d19d
Reviewed-on: https://dart-review.googlesource.com/45320
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-03-07 12:22:33 +00:00
Peter von der Ahé 94aa20dd07 Update status for $compiler == fasta
Change-Id: I5d073d1c678dc313e79193074c6491085c093596
Reviewed-on: https://dart-review.googlesource.com/45381
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-03-07 10:32:33 +00:00
Peter von der Ahé 9f56e28372 Mixin Applications with a Vengeance
Change-Id: I213f99234f29abd7e2ec03dc8451ed6dd16f3d03
Reviewed-on: https://dart-review.googlesource.com/45021
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-03-06 15:15:57 +00:00
Johnni Winther d3c3ac48a3 Remove implicit 'implements Function' for strong mode
Change-Id: Ie3e3e11a727f7fbe3c8d7af17c84dedfbdfcdf3a
Reviewed-on: https://dart-review.googlesource.com/44422
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-06 09:18:48 +00:00
Sigmund Cherem 73944a3a5c Stop running corelib_2 in dart2js legacy
TBR=sra@google.com

Change-Id: Ica678ba6531c8c09deacb3cbe875180a4ed5ecba
Reviewed-on: https://dart-review.googlesource.com/45121
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-05 23:57:10 +00:00
William Hesse a528f09443 Update status for dartkp test null_nosuchmethod_test
BUG=dartbug.com/32377
R=jensj@google.com

Change-Id: If9921a23c211081101c3aadd85ca8acb2ef96f97
Reviewed-on: https://dart-review.googlesource.com/44960
Reviewed-by: Jens Johansen <jensj@google.com>
2018-03-05 13:54:27 +00:00
Sigmund Cherem 7fd5294bb3 Add rules to build dart2js platform in strong mode
This must land after we make the libraries strong clean.

Change-Id: I3a49a2be3b2bcb15842434266f55ce49e3800fc6
Reviewed-on: https://dart-review.googlesource.com/42140
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-03-02 22:19:19 +00:00
Sigmund Cherem 9ed595b4b3 Use $fasta instead of $dart2js_with_kernel in our status files.
Note: $fasta is true when passing --dart2js-with-kernel. This change will make it
easier to flip the default: the plan is that $fasta will be true by default
later on, and passing --dart2js-old-frontend will make it false.

TBR=sra@google.com

Change-Id: Ib917d55b2d14db954c56513af057dd9a37b9c825
Reviewed-on: https://dart-review.googlesource.com/44601
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-03-01 21:02:18 +00:00
Jens Johansen 1e814d92b1 [gardening] Mark null_nosuchmethod_test as crashing
Change-Id: I440d873f78b8aacf9e6c845d12f2966e12071235
Reviewed-on: https://dart-review.googlesource.com/44460
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-03-01 13:47:59 +00:00
Lasse R.H. Nielsen 9c6ac3d3ea Mark more tests crashing on dartk+dart_precompiled.
Change-Id: I6b923c520c2252b3fdf251315c4977a5a0dcbeb4
Reviewed-on: https://dart-review.googlesource.com/44429
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-03-01 11:15:16 +00:00
Lasse R.H. Nielsen 9ee735b659 Add missing methods to List and Map implementations.
Optimize FollowedBy when the operands have efficient length.

Change-Id: I0af59240d70b929358c06b8d57a85df2deee6aaf
Reviewed-on: https://dart-review.googlesource.com/43665
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-28 12:26:53 +00:00
Sigmund Cherem e33f4f7c2e Fail if mirrors are really used.
Some legacy libraries may import dart:mirrors, but not use it. This CL turns them
into a runtime error temporarily to give some time for the library
maintainers to remove the import to dart:mirrors in the future.

Change-Id: I876133908d2a61300256915aab54730bdff51649
Reviewed-on: https://dart-review.googlesource.com/43640
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-27 04:57:27 +00:00
Lasse R.H. Nielsen 8d38d94ddb Add static list methods.
Change-Id: I40574d695826a3ed038c7c756ce980fae001325d
Reviewed-on: https://dart-review.googlesource.com/43040
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-02-26 11:34:43 +00:00
Stephen Adams 284312b101 Test for compiled-to-JavaScript version of BigInt.isValidInt
In JavaScript, and integral valued double is an 'int'.

Change-Id: I79dedcb00f74dc699f85a21a2052239ed25b7974
Reviewed-on: https://dart-review.googlesource.com/41640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-22 04:07:52 +00:00
Aske Simon Christensen 2183869465 Treat invocations on dynamic as unknown, except for return type of ==
Closes https://github.com/dart-lang/sdk/issues/32173

Change-Id: I77bd06f292a701f1b51d4077f31439598a7b4683
Reviewed-on: https://dart-review.googlesource.com/41762
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-20 16:42:25 +00:00
Erik Corry b2295f90e7 Adjust status for none_nosuchmethod_test
R=whesse@google.com

Change-Id: Ib1fa1b92cbf5d330846393c1a2e07d8f79de47ea
Reviewed-on: https://dart-review.googlesource.com/42220
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2018-02-19 12:26:39 +00:00
Erik Corry 8a6bdaab12 Make null_nosuchmethod test Dart2 compliant and mark failures
R=lrn@google.com

Change-Id: Ifcc1bf1d774b19741b4dd999128ae62b09618f47
Reviewed-on: https://dart-review.googlesource.com/39986
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-19 08:31:36 +00:00
Régis Crelier 3d756ec4ab [VM runtime] In strong mode, restrict subtyping rules of callable instances (fixes #32154).
Update kernel status files.

Change-Id: I2bf6097b5229d80cc90baed92fd8dcc750667b23
Reviewed-on: https://dart-review.googlesource.com/41482
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-14 21:48:27 +00:00
Lasse R.H. Nielsen 7ca47924ad Fix status to mark crash.
Change-Id: I141e5b2eb3960caefaab34e39d8591cf20cfbc90
Reviewed-on: https://dart-review.googlesource.com/41262
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-02-14 15:27:33 +00:00
Paul Berry c4de71ede2 Re-land "Change front_end handling of callable classes."
Original description:
Change front_end handling of callable classes.

This CL is the first in a series of CLs to change the handling of
callable classes in Dart 2.0.

For purposes of this description, a "callable class" is a class whose
interface contains a `.call` method.

In Dart 1.0, a callable class was considered to be a subtype of the
`.call` method's function type.  This allowed the user to create
custom objects with similar behavior to closures, but with additional
fields and methods.

In Dart 2.0, a callable class is just an ordinary class, with no
subtype relation to any particular function type.  (Note however that
it is still permissible for a class to declare that it "implements
Function").

To reduce the amount of code broken by this change, a piece of
syntactic sugar is being added: if an expression whose static type is
a callable class appears where a function type is expected, an
implicit tear-off of the `.call` method is inserted.

Note that it is still possible at compile time to invoke an expression
whose static type is a callable class, and it is still possible at
runtime to invoke an expression whose runtime type is a callable
class; in both cases, this is considered an implicit invocation of the
class's `.call` method.  This is unchanged from Dart 1.0 behavior.

This CL introduces test cases for the new behavior, and implements the
implicit tear-off of `.call` in the front end.

Still to be implemented in future CLs:

- Spec text needs to be written.

- DDC/analyzer code needs to be written to perform implicit tear-offs
  of `.call`.

- The subtyping algorithm in DDC, analyzer, VM, and dart2js needs to
  be changed so that callable classes are no longer considered
  subtypes of any particular function type.

- A small corner case involving type parameters still needs to be
  addressed (see TODO in
  pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart).

Fixes #32064.

Change-Id: I0d397c608321e25ba42cc02aa8a516aa77aa7c9d
Reviewed-on: https://dart-review.googlesource.com/41280
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-14 15:22:25 +00:00
Paul Berry e2bdbb8bb8 Revert "Change front_end handling of callable classes."
This reverts commit f0a6330db0.

Reason for revert: Broken bots

Original change's description:
> Change front_end handling of callable classes.
> 
> This CL is the first in a series of CLs to change the handling of
> callable classes in Dart 2.0.
> 
> For purposes of this description, a "callable class" is a class whose
> interface contains a `.call` method.
> 
> In Dart 1.0, a callable class was considered to be a subtype of the
> `.call` method's function type.  This allowed the user to create
> custom objects with similar behavior to closures, but with additional
> fields and methods.
> 
> In Dart 2.0, a callable class is just an ordinary class, with no
> subtype relation to any particular function type.  (Note however that
> it is still permissible for a class to declare that it "implements
> Function").
> 
> To reduce the amount of code broken by this change, a piece of
> syntactic sugar is being added: if an expression whose static type is
> a callable class appears where a function type is expected, an
> implicit tear-off of the `.call` method is inserted.
> 
> Note that it is still possible at compile time to invoke an expression
> whose static type is a callable class, and it is still possible at
> runtime to invoke an expression whose runtime type is a callable
> class; in both cases, this is considered an implicit invocation of the
> class's `.call` method.  This is unchanged from Dart 1.0 behavior.
> 
> This CL introduces test cases for the new behavior, and implements the
> implicit tear-off of `.call` in the front end.
> 
> Still to be implemented in future CLs:
> 
> - Spec text needs to be written.
> 
> - DDC/analyzer code needs to be written to perform implicit tear-offs
>   of `.call`.
> 
> - The subtyping algorithm in DDC, analyzer, VM, and dart2js needs to
>   be changed so that callable classes are no longer considered
>   subtypes of any particular function type.
> 
> - A small corner case involving type parameters still needs to be
>   addressed (see TODO in
>   pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart).
> 
> Fixes #32064.
> 
> Change-Id: I6a86491047ae467a5e767cb3cc7cecb570b29308
> Reviewed-on: https://dart-review.googlesource.com/40508
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Kevin Millikin <kmillikin@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
> Reviewed-by: Erik Ernst <eernst@google.com>

TBR=paulberry@google.com,lrn@google.com,leafp@google.com,dmitryas@google.com,eernst@google.com,kmillikin@google.com

Change-Id: Ia3d3a6e46ceee2b2c55938bec95d09d50bbf06a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/41240
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-14 13:10:54 +00:00
Lasse R.H. Nielsen fed7120b07 Make UnmodifiableMapView not lose unmodifiability on cast/retype.
Change-Id: I44c084353b35e16cd2fd5481d86a7be6c0b62ef3
Reviewed-on: https://dart-review.googlesource.com/41160
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-02-14 12:49:23 +00:00
Paul Berry f0a6330db0 Change front_end handling of callable classes.
This CL is the first in a series of CLs to change the handling of
callable classes in Dart 2.0.

For purposes of this description, a "callable class" is a class whose
interface contains a `.call` method.

In Dart 1.0, a callable class was considered to be a subtype of the
`.call` method's function type.  This allowed the user to create
custom objects with similar behavior to closures, but with additional
fields and methods.

In Dart 2.0, a callable class is just an ordinary class, with no
subtype relation to any particular function type.  (Note however that
it is still permissible for a class to declare that it "implements
Function").

To reduce the amount of code broken by this change, a piece of
syntactic sugar is being added: if an expression whose static type is
a callable class appears where a function type is expected, an
implicit tear-off of the `.call` method is inserted.

Note that it is still possible at compile time to invoke an expression
whose static type is a callable class, and it is still possible at
runtime to invoke an expression whose runtime type is a callable
class; in both cases, this is considered an implicit invocation of the
class's `.call` method.  This is unchanged from Dart 1.0 behavior.

This CL introduces test cases for the new behavior, and implements the
implicit tear-off of `.call` in the front end.

Still to be implemented in future CLs:

- Spec text needs to be written.

- DDC/analyzer code needs to be written to perform implicit tear-offs
  of `.call`.

- The subtyping algorithm in DDC, analyzer, VM, and dart2js needs to
  be changed so that callable classes are no longer considered
  subtypes of any particular function type.

- A small corner case involving type parameters still needs to be
  addressed (see TODO in
  pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart).

Fixes #32064.

Change-Id: I6a86491047ae467a5e767cb3cc7cecb570b29308
Reviewed-on: https://dart-review.googlesource.com/40508
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-02-14 11:03:32 +00:00
Régis Crelier 4c9a842d61 [corelib] Cleanup isValidInt and toInt() in new BigInt implementation.
Change-Id: I1f107d4f6e26ea3644bc6c9f7cff5ee6fac43958
Reviewed-on: https://dart-review.googlesource.com/40512
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-02-14 03:43:52 +00:00
Johnni Winther d30aaaa4b8 Ensure no type parameters on constructors.
Change-Id: I6a40e2f74b8a89e5873d94d406a56f82db0d0b48
Reviewed-on: https://dart-review.googlesource.com/40526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-13 11:11:05 +00:00
Stephen Adams d78c05279a dart2js runtime Dart 2 subtype check (mostly)
This change adds most of Dart 2 subtype checking to js_runtime.
The main observable change is the stronger subtyping of function types.
The subtype code is split into V1 and V2 methods with the intention to
eventually remove the V1 paths.

There is a lot of minor details that are still TODO:

- TODO: generalized void
- TODO: comparison on type variable by it's bound
- TODO: FutureOr

Change-Id: Id05db0aef5ce0d58416a72f1538a90ed67436b3e
Reviewed-on: https://dart-review.googlesource.com/37960
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-02-12 23:54:48 +00:00
Emily Fortuna 06ef399354 Fix up locals map for signature function.
Change-Id: If2a569e0799c1f63f1ee728f183cb4f1e3badb56
Reviewed-on: https://dart-review.googlesource.com/40464
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-09 20:55:19 +00:00
Emily Fortuna 36b957762e Fix up test statuses for strong mode. They apparently got super out of date. :-(
Change-Id: If3e247aecbc7969423053854468f6117ace8fe49
Reviewed-on: https://dart-review.googlesource.com/40461
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-09 18:53:36 +00:00