Commit Graph

2317 Commits

Author SHA1 Message Date
Alexander Markov ff8a989e55 [vm/bytecode] Update status for a test with missing compile-time error
Negative test cases

  generic_function_type_as_type_argument_test/01
  generic_function_type_as_type_argument_test/02

rely on a compile-time error, which is still missing in CFE.
Unlike default VM, bytecode pipeline does not flag this error.

Change-Id: I3c052b5ca6013ab0728ffc234b5ffbe2fddfec5d
Reviewed-on: https://dart-review.googlesource.com/71600
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-08-27 17:59:10 +00:00
Daniel Hillerström 8b92fe3bbd Checks whether a class extends or implements FutureOr.
According to the specification (§10.9) it is a compile-time error to
extend, implement, or use FutureOr as a mixin.

Expands the "multiple implements" check to include a test for whether
a class attempts to extend or implement the 'FutureOr' class.

The mixin case is indirectly caught by another syntactic check for
mixed in types (c.f. checkSemantics method in source_loader.dart). It
verifies whether a mixin has zero constructors. Since FutureOr has a
constructor the check fails. This is technically enough to meet the
specification, but it leads to a confusing error message for this
particular case. To improve the quality of the error message, we may
want to merge some of the mixed in check into checkSupertypes in
kernel_class_builder.dart.

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

Change-Id: I887ea9431fd50059399937f4236523ed917e3673
Reviewed-on: https://dart-review.googlesource.com/71141
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-27 08:31:15 +00:00
Konstantin Shcheglov 07fb992964 Report CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/25161
Change-Id: I27ebc09fd9fcd6d6d992268f158e80477c41d042
Reviewed-on: https://dart-review.googlesource.com/71424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-26 20:09:46 +00:00
Konstantin Shcheglov 04e2ada09b Report StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS for dynamic and type parmaeters.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/28813
Change-Id: Iae43c0bb913bfd06fa09ddeacd6fdb8f81eccf9a
Reviewed-on: https://dart-review.googlesource.com/71423
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-26 03:42:31 +00:00
Dan Rubel aa6945d5e9 First cut basic mixin declaration parsing support
... with parser recovery added in subsequent CLs.

Change-Id: I7a73e8e2a4dee961920fe9854bcd108bb1041b20
Reviewed-on: https://dart-review.googlesource.com/70882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-24 21:58:55 +00:00
Paul Berry 3d27982419 Add a language_2 test for invalid assignment to postfix increment.
Prior to c95ef874aa, case 02 crashed the
front end.  Prior to f074f3c120, case 01
crashed analyzer/FE integration.  Prior to
a94e43af7c, cases 02 and 03 crashed
analyzer/FE integration.  So it seems worth adding a test to make sure
we don't regress.

Change-Id: I0e1af7d9ed397d40dd1aebab3ff919999379d824
Reviewed-on: https://dart-review.googlesource.com/71369
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-24 18:29:14 +00:00
Paul Berry d2a4358bef Add a language_2 test reproducing #34235.
Change-Id: Icaf6329729a17b20a591ae6e9b8bf7c0d2e21265
Reviewed-on: https://dart-review.googlesource.com/71368
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-24 18:27:09 +00:00
Konstantin Shcheglov b255f0fab6 Resolve required arguments after named.
Change-Id: I2947be1fc20b1455e7865c34e35349977d61f70b
Reviewed-on: https://dart-review.googlesource.com/71382
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 22:04:12 +00:00
Samir Jindel 2beb05b829 [vm] Re-land use of multiple entrypoints for closure calls.
Original patchset is in revision 1.

Change-Id: I29ab0dbc3711f99895fd4f04a49d4185463a1602
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/71241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-23 17:54:19 +00:00
Samir Jindel 723eeccb36 [vm] Update status files after 23e379d0.
Change-Id: Iebb47fc431b44c340ee64e389aabc0e16e48e3d9
Reviewed-on: https://dart-review.googlesource.com/71301
Commit-Queue: Samir Jindel <sjindel@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-23 17:00:28 +00:00
Daniel Hillerström 23e379d0aa Checks whether an interface is implemented multiple times.
It is a compile-time error if an interface appears multiple times
across the extends and implements clauses.

This CL implements a check to detect the aforementioned case. A
previous commit implemented this by expanding and refactoring the
restricted super types check in source_loader.dart
(c.f. checkSemantics method). The restricted super types check decides
whether a type is allowed to appear in an 'extends', 'implements', or
'with' clause. However, it turned out it may have sat too early in the
compilation pipeline as it failed to detect the following case

   class A implements Object {}

I decided that it was somewhat suboptimal to implement a special case
for "Object". Therefore I have moved the check to a later stage in the
pipeline, where classes without a super class have had the Object
class injected as their default super class. The check is now
implemented in kernel_class_builder.dart (c.f. checkSupertypes
method).

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

Change-Id: Ie7153c896337b589118cac4b80e9df8ea5a09daa
Reviewed-on: https://dart-review.googlesource.com/70864
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-23 14:36:40 +00:00
Daniel Hillerström 6c812c27be Signal a compile-time error if a const constructor redirects to a
non-const constructor.

This CL also slightly improves the quality of the error message for
when a const constructor redirects to a non-const super constructor.

Note the two redirection checks are implemented in separate parts of
the code base. The former is implemented in finishConstructors in
kernel_target.dart, whilst the latter is implemented in
buildSuperInitializer in body_builder.dart. It might make sense to
localise them.

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

Change-Id: Id9db06aaba9b5a330e22ea328d0ae60f104dfdcf
Reviewed-on: https://dart-review.googlesource.com/71165
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
2018-08-23 12:19:07 +00:00
Martin Kustermann 92ff078db1 [VM] Add missing regression test for dartbug.com/34238
Issue https://github.com/dart-lang/sdk/issues/34238

Change-Id: If4ee2e09cd6764dd3dd7f88dfc3d007989f68eb5
Reviewed-on: https://dart-review.googlesource.com/71245
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-08-23 11:23:14 +00:00
Régis Crelier e434142df0 [VM interpreter] Isolate may be NULL in thread.
This fixes a crash in StackFrameIterator when using interpreter.
Prevent timeout in thread test when using interpreter.
Adjust kernel status file for known issue.

Change-Id: I9e28675a3532153df24456e65407a8ce73503928
Reviewed-on: https://dart-review.googlesource.com/71222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-22 22:11:42 +00:00
Paul Berry e2aceb692e Fix analyzer/FE integration of prefix/postfix increment of non-l-values.
Fixes 2 language tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I74f98f328c203fb68d8ebf819230dbe9405cfc7d
Reviewed-on: https://dart-review.googlesource.com/71225
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-22 21:57:21 +00:00
Paul Berry 43a8f1d0d6 Fix analyzer/FE integration of assignment with synthetic LHS, inside class method.
Error recovery generates a slightly different kernel representation
for "= x" inside a class method vs. outside a class method.  Inside a
class method, the synthetic LHS is a property access; outside a class
method it is a variable access.  The "outside a class method" case was
addressed in 55aa031404f36d181daf5f5b27424da431ee2e3e; this CL
addresses the "inside a class method" case.

Fixes 1 language test with [ $compiler == dart2analyzer && $fasta ].

Change-Id: Ib9429cac13b775a7d0b40a13468117c442611531
Reviewed-on: https://dart-review.googlesource.com/71223
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-22 20:31:24 +00:00
Aske Simon Christensen a4b3009ca5 Require super initializer to be at the end of the initializer list.
Drops code to handle special evaluation order rules for super
initializer before the end.

Initializer check code now also recovers from initializer errors.

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

Change-Id: I1024853bfd3acfef42630bdc2fc47782746b07c0
Reviewed-on: https://dart-review.googlesource.com/68060
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-22 10:43:08 +00:00
Lasse R.H. Nielsen a6e14ae3e6 Fix language_2/string_interpolation_and_buffer_test.
It was badly converted to Dart 2, and was both using and testing things
that can no longer happen (like returning a non-null non-String value
from toString).

Change-Id: I085d1172f177e80c3f75af36a2028b7ea241713a
Reviewed-on: https://dart-review.googlesource.com/71144
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-08-22 10:35:14 +00:00
Johnni Winther d456532124 Disallow non-js interop external members
Change-Id: Ic73a3e2b16bdf77a2cd94fdcfaffe7989a798909
Reviewed-on: https://dart-review.googlesource.com/70513
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-08-22 06:59:46 +00:00
Daniel Hillerström 5780deb18a Signal a compile-time error when a type variable name conflicts with a setter name.
Specification disallow name conflicts between
  - type variables and class names
  - type variables and getter names
  - type variables and member names

Although not present in current specification, the language team confirms that
it is also supposed to be a compile-time error if there is conflict with a setter.

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

Bug:
Change-Id: Ia25bc91c3287f93ae43faae121a1f9d81b179c6b
Reviewed-on: https://dart-review.googlesource.com/70500
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-22 06:55:22 +00:00
Paul Berry 40d72aec8c Re-land "Fix analyzer/FE integration of assignments to ambiguous types."
This reverts commit 9f795883f1.

Change-Id: I485d0722fe8651212660dc961ae9271045ee0c54
Reviewed-on: https://dart-review.googlesource.com/71100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-22 03:13:21 +00:00
Paul Berry 9f795883f1 Revert "Fix analyzer/FE integration of assignments to ambiguous types."
This reverts commit 1b5d273fd7.

Reason for revert: Windows bot breakage

Original change's description:
> Fix analyzer/FE integration of assignments to ambiguous types.
> 
> Fixes 2 language_2 tests with [ $compiler == dart2analyzer && $fasta ].
> 
> Change-Id: I600c7f075d0beb31863a4d17a6764afa2c7187be
> Reviewed-on: https://dart-review.googlesource.com/70982
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

Change-Id: Iaefb47e983266d2c81b8beb3c8a5b85eac345be8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/71080
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 23:52:28 +00:00
Paul Berry 1b5d273fd7 Fix analyzer/FE integration of assignments to ambiguous types.
Fixes 2 language_2 tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I600c7f075d0beb31863a4d17a6764afa2c7187be
Reviewed-on: https://dart-review.googlesource.com/70982
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 21:13:18 +00:00
Paul Berry e87efdffb4 Fix analyzer/FE integration of assignments to ambiguous types.
Fixes 1 language test with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I807ca277e6e1f6fb81954be5e72b42cdec8c1b68
Reviewed-on: https://dart-review.googlesource.com/70961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 19:27:37 +00:00
Paul Berry d10204f3a0 Fix analyzer/FE integration of assignments to non-l-values.
This required introducing a new generator type to represent a
non-l-value, so that we can re-use the machinery of DelayedAssignment.

Fixes 6 language_2 tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: Ida2985df6d798d5466948e5de3dce5c17c2de7ac
Reviewed-on: https://dart-review.googlesource.com/70842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 16:45:07 +00:00
Aske Simon Christensen a95db177b8 Fix VM status after language_2 triage
Status file adjustment after ee6ef702ce

Change-Id: I084e14e8983333bb951d16cb88f4f641187d8fcb
Reviewed-on: https://dart-review.googlesource.com/70865
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-08-21 13:07:04 +00:00
Aske Simon Christensen ee6ef702ce Update issues for Fasta missing compile-time errors in language_2
Clean out dart2js/ddc status entries that are subsumed by the generic
one for Fasta in language_2_kernel.status.

Change-Id: If70ae797384af488d816082a9d041d48ed6b5876
Reviewed-on: https://dart-review.googlesource.com/70280
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-21 11:23:10 +00:00
Kevin Millikin 2a36502b02 Squelch some false warnings for disallowed uses of void
The rules for void are changed to allow uses of void where we
previously had a warning, such as the case of assignment to a
variable of type void or passing as a parameter of type void.

Change-Id: I1c1513b0000fa1c8eedbe2645fab503b28024fa3
Reviewed-on: https://dart-review.googlesource.com/70265
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-08-21 09:48:44 +00:00
Johnni Winther d7c71862da Check setters in Dart 2
Change-Id: I3a0bb90f34072cb4ef47f2712c43e4779b92fbdd
Reviewed-on: https://dart-review.googlesource.com/70514
Reviewed-by: Stephen Adams <sra@google.com>
2018-08-21 08:21:02 +00:00
Paul Berry a814614cf4 Fix analyzer/FE integration of invalid assignments to classes.
To ensure that the resolution of the class name is communicated to the
analyzer, we take advantage of SyntheticExpressionJudgment.original,
which allows us to ensure that type inference is performed on a
synthetic read of the class name expression.  This causes the
appropriate information to be communicated to the analyzer, and then
at runtime the value produced by the synthetic read is discarded.

Fixes 15 language_2 tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I02ad23acbb64c297129f59ff56171399bf067c33
Reviewed-on: https://dart-review.googlesource.com/70780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 00:27:28 +00:00
Alexander Markov 844b7a9c40 [Test] Add test case for capturing variables in nested sync* closures
Change-Id: Id16b877dd3743a7242148479f8c5d6c2802b35ef
Reviewed-on: https://dart-review.googlesource.com/70681
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-08-20 20:19:54 +00:00
Régis Crelier a37496d24d [VM interpreter] Fix native call to growable list factory.
Mark a few failures as expected, due to lack of line numbers in stack traces.
Move restoring of pool pointer out of inlined macro after exception.

Change-Id: I8ef1e0f86a1eabe42e007968481e0133d0e5e360
Reviewed-on: https://dart-review.googlesource.com/70741
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-20 20:12:54 +00:00
Paul Berry fc24d41b47 Fix status file for super_call4_test/01
We were attempting to "override" a failing test for the analyzer by
putting a "pass" annotation in a more specific section of the status
file.  But that doesn't have the intended effect--it just means that
when the test is run for the analyzer, either a pass or a fail result
is accepted.

Change-Id: Iccd7e68c746e7989840c6d0e6ee16bd4f0677e2d
Reviewed-on: https://dart-review.googlesource.com/70163
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-20 18:12:05 +00:00
Mike Fairhurst 222ac2498a Revert "Fix #33415 no error for awaiting a void expression."
This reverts commit 9727a4a4ef.

Reason for revert: Internal breakage; needs to be landed behind a flag.

Original change's description:
> Fix #33415 no error for awaiting a void expression.
>
> Bug:  33415
> Change-Id: I4d4e81fef79a5bc5162e37ab07a8fe99e50c8dfc
> Reviewed-on: https://dart-review.googlesource.com/60522
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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


Bug: 33415
Change-Id: I66e1bc58bc0966a2348804dbdef6f5901b6aaf55
Reviewed-on: https://dart-review.googlesource.com/67100
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-17 23:48:46 +00:00
Aske Simon Christensen f8a96b88e9 It is an error if a final field is not initialized.
Bug: https://github.com/dart-lang/sdk/issues/33022

This commit adds an error when a final field is not initialized at all
(and there is at least one generative constructor). A later commit
will add an error for the case where a field is initialized by some,
but not all, generative constructors.

A number of classes in the Dart2js and DDC support libraries use
uninitialized final fields to indicate getters in the corresponding
native classes. This commit adds a temporary whitelist for the
affected files, which can be removed when the fields have been
replaced by external getters.

This is tracked by https://github.com/dart-lang/sdk/issues/33762

Change-Id: I6b5cee230c7cd5554da2b61da7ebddb6b0b9396e
Reviewed-on: https://dart-review.googlesource.com/63781
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-17 12:37:52 +00:00
Régis Crelier 2c6ad6e76d [VM interpreter] Disable code optimization when running interpreted tests.
Change-Id: Ie8be83b5223db5c73d0d98ddc03e26d757d1ea29
Reviewed-on: https://dart-review.googlesource.com/70480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-17 01:53:26 +00:00
Leaf Petersen 891b7164ac Fix overly strict invalid return checking.
In changing the proposed spec to address comments in a way that was intended to be
non-breaking, I accidentally introduced some new (unintended) restrictions.  This
fixes the spec, rolls back the change in analyzer, and adjusts the language tests
appropriately.

Change-Id: I487b0eaacbfa1447d4ee909c0a56e435c2088990
Reviewed-on: https://dart-review.googlesource.com/70462
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-08-17 01:25:18 +00:00
Daniel Hillerström 0db6545b51 Illegal return type check for functions marked async* or sync*.
Extends the illegal return type check for async functions to cover
illegal return types for functions marked async* or sync* as well.

Adds new error messages for illegal return types of functions marked
async, async*, and sync*. These error messages conform with those
produced by the analyzer.

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

Bug: www.dartbug.com/33068
Change-Id: I6d8690537139d3d094a4e295fcac9de4f4a7f0af
Reviewed-on: https://dart-review.googlesource.com/69581
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-16 07:07:40 +00:00
Dan Rubel 825df975a0 Revise fasta type arg/param parsing to ignore "<".endGroup
The scanner associates '<' with '>' and '>>',
but the parser cannot use '<'.endToken/endGroup reliably
and wastes time updating that token's endToken/endGroup field.

This CL updates type info parsing to ignore '<'.endGroup
and step through the token stream (which it has to do anyway),
for improved parsing.

This CL causes a handful of existing tests to fail (marked as @failingTest)
and test failures will be addressed in a subsequent CL.

Change-Id: I788e9a74cd2891f98f44bba15d5669febfec6c64
Reviewed-on: https://dart-review.googlesource.com/70001
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 22:16:40 +00:00
Paul Berry 5d400eedf6 Update analyzer/FE status entries with pointers to issues
Change-Id: I414a44d8cb86d2f91781568557b02e9164c8225b
Reviewed-on: https://dart-review.googlesource.com/70101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-15 13:11:59 +00:00
Kevin Millikin de4fe651c1 Add individual lines for the void and invalid returns tests
Add individual status file lines for failing tests in all
configurations that use Fasta.

Change-Id: I5ef182e5dc1cb2c693c178f071020bd99f611c91
Reviewed-on: https://dart-review.googlesource.com/69960
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-15 11:41:10 +00:00
Daniel Hillerström b13c4e4c9f Updates status file to expect MissingCompileTimeError for illegal
async function return type check whenever running in 'legacy mode'.

Adapts language_2_kernel.status such that a MissingCompileTimeError is
expected for illegal return types of async functions when running in
'legacy mode'. Updates the commentary in finishFunction in
body_builder.dart.

Some legacy tests* have revealed that it may not always be correct to
check whether [strongMode] is enabled before checking the return type of
async functions. The reason behind the strongMode check was to ensure
that [_typeInferrer.typeSchemaEnvironment] would be instantiated as
per ahe's suggestion.

There seems to be some inconsistency in the code base as to when
[_typeInferrer.typeSchemaEnvironment] is non-null. For example, during
the fasta perf benchmarks one may observe a null value, whilst it
seems that the member is always non-null when running `dart
--no-preview-dart-2 <script.dart>`.

* test log: https://ci.chromium.org/p/dart/builders/luci.dart.ci.sandbox/front-end-legacy-linux-release-x64/621

Change-Id: I2211bfe0ae75a7aa35e2d698ff5cba27af484d07
Bug: 33425
Reviewed-on: https://dart-review.googlesource.com/69920
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-15 06:52:48 +00:00
Leaf Petersen 0c7fa585e3 Adjust status files for analyzer_use_fasta_parser to fix bot failures.
Change-Id: I39998e982f90a9499c9261848bd57955826d2e1c
Reviewed-on: https://dart-review.googlesource.com/70022
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-08-14 19:21:00 +00:00
Leaf Petersen 5a8afa76b1 Triage language tests for void in DDC and analyzer
Change-Id: Ib72fa4515ac29b66d90b237739f97219b98acda2
Reviewed-on: https://dart-review.googlesource.com/67282
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-08-14 17:42:43 +00:00
Paul Berry 9cfe7f49e7 Triage the remaining analyzer/front_end integration language_2 failures.
For most failures I've added a comment with a short description of the
failure.  In a few places I've included a reference to an issue in the
issue tracker.  I'll follow up with a CL that assigns issues to the
remaining failures (and I'll file issues if necessary).

I haven't tried to classify the "MissingCompileTimeError" or
"MissingStaticWarning" cases, since they are most likely due to
error/warning checks that haven't been implemented in the front end
yet, and that work is being tracked elsewhere.

Change-Id: I41559ed848a687767eb1018502cbbc104569a7cd
Reviewed-on: https://dart-review.googlesource.com/69880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-14 01:07:45 +00:00
Devon Carew 580f809949 Convert the current analyzer --use-cfe test results to language2 status file entries.
Change-Id: I39a1573b0c0e5c85524cb654a5febea09fb9577a
Reviewed-on: https://dart-review.googlesource.com/69720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-08-13 19:46:56 +00:00
Daniel Hillerström b244c0805d Extends the type checking of async functions to check whether the
declared return type of an async function is a super type of Future<T>
for any T.  In case the check is not successful an error message is
produced. The location of the name of the offending function
declaration is used as location information for message. Ideally we
would use the location of the type, so until types get annotated with
location information the error message remains suboptimal.

This closes #33425 and closes #34057.

Thanks to dmitryas and jensj for their helpful guidance.

Bug: dartbug.com/33425 dartbug.com/34057
Change-Id: I3b3dadc25b574422ea1f38671fe8cba3ffdd494c
Reviewed-on: https://dart-review.googlesource.com/69307
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-08-13 12:22:47 +00:00
Aart Bik fe6daed58b [vm/compiler] "fast"-path for x64 division
Rationale:
Since 64-bit division requires twice as many cycles
and has much higher latency compared to the 32-bit
division, even for a non-speculative 64-bit path,
a 32-bit "fast path" makes sense.

Speedup:
About 2x for cases that fit 32-bits. No noticable
slowdown for the 64-bit cases.

https://github.com/flutter/flutter/issues/19677
https://github.com/dart-lang/sdk/issues/33967

Change-Id: I0d3b44564fee2cda03fc36f089a4424084732de0
Reviewed-on: https://dart-review.googlesource.com/69200
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-10 17:48:24 +00:00
Aske Simon Christensen f2766eb24e Disallow references to this in field initializers.
Fixes https://github.com/dart-lang/sdk/issues/33858

Change-Id: I619de64353ac5131d949d8e3898617435e9f6dcc
Reviewed-on: https://dart-review.googlesource.com/68920
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-10 11:12:58 +00:00
Aart Bik 71d96019d1 [vm/compiler] Introduce 64-bit NEGATE - all archs.
Rationale:
This improves JIT and AOT performance of unary minus
and also improves constant folding and range analysis
on negative constant (viz. x / -3 is often x / - (3)).
The SHIFT operator needed some special treatment, since
we have to avoid converting a NON-speculative shifts
back into a deopt.

https://github.com/dart-lang/sdk/issues/34072

Change-Id: I230c9cfda98297f683bbba53688e57c2cc659360
Reviewed-on: https://dart-review.googlesource.com/68434
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-08-09 16:43:18 +00:00