Commit Graph

221 Commits

Author SHA1 Message Date
Nate Bosch cf03e96b90 Remove appJit and precompiled compiler options
Towards #37318

- appJit has been replaced by appJitk and is no longer.
- precompiled has been replaced by dartkp and is no longer used.
- For the precompiled runtime, default to dartkp.
- Remove status file references to these compiler options and normalize
  status files.

Change-Id: I48728db13dc84737092a92314e2f474a9309f4d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106942
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-24 16:07:27 +00:00
Lasse Reichstein Holst Nielsen a957c4351a Add more tests for async*/await-for operations.
Change-Id: Icadb9edfe2ef40aff3808295685f961897d63c9a
Reviewed-on: https://dart-review.googlesource.com/c/86181
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-12-10 14:38:34 +00:00
William Hesse c71a5279c5 Revert "Add more tests for async*/await-for operations."
This reverts commit a0d576e6cd.

Reason for revert: Turned many buildbot builders red. Use the "Choose tryjobs" button to run more configurations on this type of commit.  Use the "tools/bots/approve_results.dart" tool to update expectations for builders running the new workflow

Original change's description:
> Add more tests for async*/await-for operations.
> 
> Change-Id: I2c8ffb8a6738b8dee43cfdf85be0c54d2735b6cc
> Reviewed-on: https://dart-review.googlesource.com/c/85391
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com

Change-Id: I81830c3fc565b62e98538feba9bd64c6dd11dd51
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/86023
Reviewed-by: William Hesse <whesse@google.com>
2018-12-04 20:09:46 +00:00
Lasse Reichstein Holst Nielsen 3000e93024 Update status file for yet another combination.
Change-Id: Ic5be67964e9179205cf7352a61e1e98df7778dd7
Reviewed-on: https://dart-review.googlesource.com/c/85951
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-12-04 15:54:00 +00:00
Lasse Reichstein Holst Nielsen a0d576e6cd Add more tests for async*/await-for operations.
Change-Id: I2c8ffb8a6738b8dee43cfdf85be0c54d2735b6cc
Reviewed-on: https://dart-review.googlesource.com/c/85391
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-12-04 13:58:03 +00:00
Mike Fairhurst 8860fad862 Triage analyzer status files
Change-Id: I5f6f5e232a084db1004c99bfcef45795c5bed4d4
Reviewed-on: https://dart-review.googlesource.com/73682
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-09-12 00:29:50 +00:00
Martin Kustermann ba119d7292 [VM] Remove "$compiler == precompiler" sections from language_2_precompiler.status
All of those tests are already skipped in the legacy "$compiler == precompiler" configuration.

Change-Id: I963c66d32cf79bed99e81e30aef40f7d01a12cef
Reviewed-on: https://dart-review.googlesource.com/68921
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-09 09:30:54 +00:00
Leaf Petersen 1a832455e6 Triage language tests for void
Change-Id: I4fc4bc583f6fe25a0a083efc6b9cda5ef9ae5ceb
Reviewed-on: https://dart-review.googlesource.com/66521
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-08-03 23:21:23 +00:00
Lasse R.H. Nielsen b1eeacc30a Remove usage of unittest package from a number of tests.
Add simplified unittest replacement to package:expect.
(It is used in multi-tests, so it needs to be in an accessible place without using ".." in its path).

Change-Id: I60aa212ed67ffbdda17ca18fce1cdff16237f4fe
Reviewed-on: https://dart-review.googlesource.com/65700
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-07-20 13:26:38 +00:00
Bob Nystrom 67525aef37 Convert a batch of negative tests to multitests.
Change-Id: I380c12ef633ec8c40de982782623d3e3659a4834
Reviewed-on: https://dart-review.googlesource.com/57162
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-06-08 19:43:34 +00:00
Lasse R.H. Nielsen a4494a7fb2 Make mixin and interface built-in identifiers.
Fixes #33113

Bug: http://dartbug.com/33113
Change-Id: I4b0b7c9d82ae9df6a7e9f71168ca981c62c7a2f1
Reviewed-on: https://dart-review.googlesource.com/55222
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-18 09:57:17 +00:00
Jenny Messerly 3002e47e36 cleanup language_2 and corelib_2 tests that import dart:mirrors
Preserves tests that didn't really need mirrors, and moves tests for
mirror functionality into lib_2/mirrors tests.

Change-Id: Ie16dee1a4b508e3f14da53499f57c5dae2d1e513
Reviewed-on: https://dart-review.googlesource.com/49624
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-07 23:50:56 +00:00
Paul Berry 8f52be2282 Don't infer types when there's an irreconcilable type mismatch.
Also fix the type inference algorithm so that when it explores
multiple alternatives (as a result of the use of FutureOr<>), if one
alternative generated some constraints but failed to produce a match,
it rewinds those constraints and tries the other alternative.
(Previously, it erroneously assumed that if any constraints were
generated, the alternative matched successfully).

Also add unit tests to verify the proper operation of the subtype
match algorithm.

Fixes #32305.

Change-Id: I060b5d6d5247a68d2b27bba78819bae172e43d97
Reviewed-on: https://dart-review.googlesource.com/53685
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-05-03 23:27:14 +00:00
Dan Rubel 79a15f52bf Fix isValidMethodTypeArguments
Change-Id: I3c4bb8dc981c285b8ecfad7dcd7dc849ed1bda7b
Reviewed-on: https://dart-review.googlesource.com/52920
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-28 18:10:06 +00:00
Aske Simon Christensen 9c2fcedaf4 Error on missing method implementation in non-abstract class
Bug: https://github.com/dart-lang/sdk/issues/32013

Change-Id: I163a84e70e94852a05ce99b07ec883c610ea788c
Reviewed-on: https://dart-review.googlesource.com/52320
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-04-24 13:07:54 +00:00
Aske Simon Christensen f06118ef8f Dart 2 fixes to various tests.
All fixes are related to the requirement that a concrete class must
implement its entire interface or have a non-trivial noSuchMethod
implementation.

Change-Id: I015e0565e5dd9cfa324c38bb43696e365c58329a
Reviewed-on: https://dart-review.googlesource.com/51880
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-04-20 12:57:19 +00:00
Aske Simon Christensen 2b09c1efc0 Revert "Error on missing method implementation in non-abstract class"
This reverts commit 7cc55d0372.

Reason for revert: More test fixes needed.

Change-Id: Ib36159184ffbd14ce3f7cca184ce2b8cdfec237c
Reviewed-on: https://dart-review.googlesource.com/51680
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-18 17:27:22 +00:00
Aske Simon Christensen 7cc55d0372 Error on missing method implementation in non-abstract class
Closes https://github.com/dart-lang/sdk/issues/32013

Change-Id: I8f49d2640ef92a3d9d723969208cdb5f397e806d
Reviewed-on: https://dart-review.googlesource.com/43660
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-18 14:39:09 +00:00
Alexander Thomas 3851591642 [infra] Keep comments intact when updating status files.
* Preserve empty lines in the file header.
* Add empty entry to the tool's newly created sections.
* Remove extra empty line at the end of the file.

Change-Id: I271583774d5f5497025a9d85bcadf8b0b9e39e81
Reviewed-on: https://dart-review.googlesource.com/37600
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-04-10 19:03:21 +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
Dmitry Stefantsov 2fcdfc1f23 Rename bug32353{,_2}_test.dart to issue32353{,_2}_test.dart
Change-Id: Id00f2713dda2fcb62d43d5f7f2034b8f09bb12c1
Reviewed-on: https://dart-review.googlesource.com/46020
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-03-12 10:50:17 +00:00
Alexander Markov 7aa3e54acf [vm] Fix computation of hashCode of a closure with null receiver
As tests/language_2/tearoff_dynamic_test.dart shows, it is perfectly
valid to take a tear-off of an instance method from null, and then call
hashCode from such tear-off.

The implementation of hashCode for closures, Closure::ComputeHash()
was calling Instance::Cast(receiver) which asserts for null.
This code is revised to allow null receiver.

Change-Id: I85cc7abf25aab99590b53403904e8bac25328308
Reviewed-on: https://dart-review.googlesource.com/45749
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-03-09 00:26:31 +00:00
Paul Berry db08061424 Handle implicit tear-off of .call when an implicit downcast is required
Previously, we were setting `expression` incorrectly after generating
the implicit tear-off of .call, so if an implicit downcast was needed
as well, it was not attached to the proper kernel node, and the
resulting kernel representation was invalid.

Addresses the front end manifestation of #32426.

Change-Id: Ibd86b75c54a53db1fc4606b7583910c57e1c4aae
Reviewed-on: https://dart-review.googlesource.com/45522
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-03-07 13:59:39 +00:00
Paul Berry 2993476129 Report an error if a class inconsistently implements a generic interface.
This is not allowed in Dart 2.0.

Change-Id: I6861ce298e5d5a5cf3f26a010990868b5ba9bda2
Reviewed-on: https://dart-review.googlesource.com/39601
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-05 12:13:12 +00:00
Paul Berry 11cbdbe26e When checking mixin type inference errors, don't skip mixins with explicit type args.
Fixes #32372.

Change-Id: I77bcdcdb5a764ba1d6075176800fa038aa46a1f9
Reviewed-on: https://dart-review.googlesource.com/44440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-05 09:10:01 +00:00
Paul Berry b1a5325171 Suppress "extends" check when inferring mixins.
This should be safe since the purpose of the inference is to find an
exact match for each type parameter; if an exact match is found but it
doesn't satisfy the "extends" constraint, that will be detected and
reported later.  If an exact match isn't found, the type bound will be
filled in my instantiate-to-bounds.

Addresses the analyzer portion of issue #32353.

Change-Id: Ic9f71eefac2fa3f6f126957b9d1652ca1d990b89
Reviewed-on: https://dart-review.googlesource.com/44220
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-01 05:55:26 +00:00
Paul Berry b119f7a4cd Only allow implicit use of .call if it refers to a method.
Change-Id: I4c332b64eb7338ceaf63544c3dd0317f8c7d4538
Reviewed-on: https://dart-review.googlesource.com/42020
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-21 14:12:14 +00:00
Leaf Petersen e82e3df5a8 Fix more more status
Change-Id: Ib336438199f9f6a90b083756e57ed249cc83fa98
Reviewed-on: https://dart-review.googlesource.com/42082
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-17 02:52:11 +00:00
Leaf Petersen 3d6ad7b3a2 Remove fuzzy arrows except on assignability
Change-Id: I00ffa8f6f85cede8badd4d7082da4603f998956c
Reviewed-on: https://dart-review.googlesource.com/40470
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-02-17 00:30:56 +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
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
Peter von der Ahé 8815bbe90e Update status files for $compiler == fasta
Change-Id: I09761d12b98864d9a9abcc7abe6f046e45951715
Reviewed-on: https://dart-review.googlesource.com/36642
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-02-07 15:38:09 +00:00
Paul Berry d9d2dc405b Infer mixin types in the analyzer.
This follows Leaf's simplified suggestion.  As a temporary hack it
assumes that the mixin passes its type parameters through to its
superclass constraint unchanged.

Change-Id: I091b44005d6364a91e20578f2ff6340334b1fab6
Reviewed-on: https://dart-review.googlesource.com/38040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-07 10:45:39 +00:00
Régis Crelier ed1d8bd475 [VM parser] Complete support for generalized void (fixes #30516).
'void' is now allowed as type annotation for locals, fields, and formal
parameters, in addition to being previously allowed as type argument.
Update status files.

Change-Id: I6459f56824dc0a695615d8dc87c9a8a1f9be29ef
Reviewed-on: https://dart-review.googlesource.com/37651
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-01-31 00:56:41 +00:00
Lasse R.H. Nielsen d2aae0a45f Fix tests in language_2 to test strong mode semantics.
Change-Id: I74dced985475fe48c900bfd6b6cece85f64b54cd
Reviewed-on: https://dart-review.googlesource.com/36581
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-25 10:57:42 +00:00
Paul Berry 314b89e11d Update the analyzer to require noSuchMethod overrides to be concrete.
See 38dcb10543 for details.

Change-Id: I00608f7106e1b37cde81b8145d8d748f8cd97804
Reviewed-on: https://dart-review.googlesource.com/36520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-24 13:55:18 +00:00
Jenny Messerly 4532c99730 fix covariance checks for DDK, and setters in DDC/K
Change-Id: I388f58eb918110494d70eeb34f1dae68184195ee
Reviewed-on: https://dart-review.googlesource.com/35840
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-23 23:48:06 +00:00
Paul Berry 236ea5bb44 Add further test cases reflecting the consensus on #31596.
Change-Id: Ib67f8ae239b89bf56efc059054b6430e27a0e66f
Reviewed-on: https://dart-review.googlesource.com/34922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-01-20 17:10:57 +00:00
Paul Berry 23cba1d438 Issue a warning if top-level inference depends on an implicitly typed instance getter.
If an implicitly typed top level variable or field depends on an
implicitly typed instance getter or instance field, the analyzer
implementation of type inference isn't guaranteed to infer the
depended-upon field first, therefore the type might be inferred
incorrectly.

The new front end doesn't have this problem, so the user's code will
execute correctly at runtime, but they might get confusing results
from the analyzer.  To alert users of this problem, we issue a
compile-time warning whenever an implicitly typed top level variable
or field depends on an implicitly typed instance getter or instance
field.

Change-Id: I100bcbe1a76472bcb7d493eb12e4a3e2d0605e79
Reviewed-on: https://dart-review.googlesource.com/35385
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-17 21:58:28 +00:00
Paul Berry 7339e1ffe7 Fix handling of forwarding semi-stubs in the front end.
See #31649 for more details about forwarding semi-stubs.

Change-Id: I2af7fb0c5de01d7732279a6ca8254985f396683a
Reviewed-on: https://dart-review.googlesource.com/35003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-17 17:47:58 +00:00
Régis Crelier 0c2793b3db [VM runtime] Implement support for _extractTypeArguments in the VM (fixes #31805).
Update status files.

This cl includes implementing these two features on all platforms:
1) Support calling generic functions via DartEntry::InvokeFunction().
2) Support native generic functions. These are currently allowed, but type
   arguments are ignored, and therefore not accessible from the C++ side.

Change-Id: Id39e8ca46c2ba1ba3d46946c16712a8572ff64ea
Reviewed-on: https://dart-review.googlesource.com/34023
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-12 21:32:20 +00:00
Régis Crelier 0f08aababa [VM parser] Fix look-ahead parsing of void as type argument.
This is part of implementing generalized void, see #30516.
Add regression test.
Update status files.

Change-Id: I0b4730734238b4dc463ddd7835e30ea8a2bd4300
Bug:
Reviewed-on: https://dart-review.googlesource.com/34224
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-11 23:42:54 +00:00
Paul Berry f2b8efde4d Add a test demonstrating the corner case mentioned in issue #31596.
Change-Id: I34abe6993e0dc85d1234878c91ce735139b9cb47
Reviewed-on: https://dart-review.googlesource.com/31750
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-11 03:50:27 +00:00
Régis Crelier f3307ca8de [language tests] Fix 2 strong mode tests related to covariant tear-offs.
Update status files.

Change-Id: I5828a86f268a767d72dddea36e009950ac5dabde
Reviewed-on: https://dart-review.googlesource.com/31401
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-12-22 20:33:36 +00:00
Régis Crelier 8836b116f9 [VM runtime] Fix function subtyping in the optimizer (fixes #31591).
The optimizer uses the "is more specific than" relation to eliminate type tests.
In strong mode, the "is more specific than" relation is supposed to be identical
to the "is subtype of" relation. However, it is not quite true, and this is the
cause of this bug. In non-strong mode (Dart 1), the "is more specific than"
relation uses covariance for both result type and parameter types of functions.
In strong mode, we need covariance of result type and contravariance of
parameter types.
Added regression test and updated status files.

Change-Id: I6315643890db75213af6720aa99d8da7b15f99d6
Bug:
Reviewed-on: https://dart-review.googlesource.com/29900
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-12-15 23:56:33 +00:00
Paul Berry ae9b0c42d7 Add type inference code to generate Instantiation nodes.
Fixes #31586.

Note that none of the back-ends handle Instantiation nodes yet, so the
language_2 tests added in this CL
(instantiate_tearoff_after_contravariance_check_test,
instantiate_tearoff_of_call_test, and instantiate_tearoff_test) fail
pretty much across the board right now.

Includes two fixes to Instantiation.getStaticType and the kernel type checker:

- Previously, they attempted to perform substitution on the full
  function type, which had no effect because the type parameters were
  bound.

- The type checker was not checking that type parameter bounds were
  satisfied.

Note that the front end doesn't yet check that type parameter bounds
are satisfied by the inferred type parameters.  I will address that in
a follow-up CL.

Change-Id: Ib0ad7a5fc5f4a2fdc8c99abe1f2d3d15b21a4974
Reviewed-on: https://dart-review.googlesource.com/29744
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 20:41:43 +00:00
Leaf Petersen 53908b0790 Remove warning for "is" checks with generic type parameters.
The analyzer used to emit a warning when a type parameter to a generic
method was used in an "is" check.  This warning was there to help
users write code that worked correctly on both Dart 1.0 and 2.0.  Now
that 2.0 generic methods are being more broadly supported and used,
this warning is blocking further library work, and is being removed.

Fixes https://github.com/dart-lang/sdk/issues/30530

Bug:
Change-Id: I70395305ad082aee3072b5beeb0b1b7f7883391b
Reviewed-on: https://dart-review.googlesource.com/29821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-15 18:12:03 +00:00
Paul Berry 4669a2107f Add a language_2 test to illustrate the scenario described in #31649.
Change-Id: I93ada8e3fb00029f5af18753c62deb78b944728d
Reviewed-on: https://dart-review.googlesource.com/29743
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-15 13:53:43 +00:00
Bob Nystrom 650c9dcc8e Support extractTypeArguments() in 1.0 mode on the VM and dart2js.
Without strong mode, a "good enough" implementation is to simply call
the generic method with "dynamic" for the type arguments, which is what
this does. That should be enough to unblock our internal users.

We also need to not report a compile error when
dart_internal/extract_type_arguments.dart imports the hidden
"dart:_internal" library.

This patch does both of those for the VM and dart2js (using its old
front end).

Note that the test still fails because the test is more particular than
most actual user code would be -- it validates that the instantiated
type arguments are *exactly* correct, and not that the returned object
is merely subtype compatible.

Bug:
Change-Id: I0343beace4991861b29712b3fd7067ec8dc8f8ba
Reviewed-on: https://dart-review.googlesource.com/28020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 19:04:18 +00:00