Commit Graph

676 Commits

Author SHA1 Message Date
Samir Jindel f5fc335a4c [kernel] Check bounds of type arguments in strong mode.
Change-Id: I2cb230db322cc26fb62e932b40882200de38c3d4
Reviewed-on: https://dart-review.googlesource.com/24180
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-01 14:55:56 +00:00
Samir Jindel e50326af39 [kernel] Update cloner.dart
Several revisions have updated ast.dart without updating cloner.dart to
clone the newly added fields. This revision fixes #31438.

Bug: https://github.com/dart-lang/sdk/issues/31438
Change-Id: I2347de69e6a424f25c04d2a773d3f8d8b8387619
Reviewed-on: https://dart-review.googlesource.com/23180
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-01 14:06:26 +00:00
Régis Crelier 9fd442107a [Gardening] Mark tests as passing in status files. See #31498 for details.
Change-Id: Ifa66601e5d504160ba7f4311e72ac84fb87240e0
Reviewed-on: https://dart-review.googlesource.com/25041
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-30 17:48:15 +00:00
Alexander Markov d282487636 Enable devirtualization optimization when testing dartkp --strong.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I09a93391eaa42ff2c258b33bb229e2ca662463db
Reviewed-on: https://dart-review.googlesource.com/24562
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-29 22:56:40 +00:00
Paul Berry 327adac235 Insert implicit downcasts for function expressions.
Note that there are currently some inconsistencies between how
function expressions are inferred depending whether they are defined
using `{}` or `=>` (see issue #31436).  This CL preserves the existing
inconsistencies.  Once we decide how we want to resolve issue #31436,
I'll revisit this code to ensure that it is still correct.

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

Change-Id: I4d87f83b8a4b3b72e7ba8042ccd711f0d012fac0
Reviewed-on: https://dart-review.googlesource.com/24340
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-29 19:20:31 +00:00
Martin Kustermann 88915b6efb Add test for int64 literal semantics in Dart 2.0
Issue https://github.com/dart-lang/sdk/issues/31479

Change-Id: Ifb303c5ea751fa5700abbbfd679e5c1517af9c5b
Reviewed-on: https://dart-review.googlesource.com/24520
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-29 16:36:30 +00:00
Paul Berry 2b567c53d4 Insert implicit downcasts for parameter default values.
No language_2 tests are added to validate this behavior yet, because
we are still deciding what we want the semantics to be.  I will follow
up with language_2 tests once the semantics have been decided upon.

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

Change-Id: Ia24c9789220d09682b4b3ade9374d279ff2a4b6e
Reviewed-on: https://dart-review.googlesource.com/24320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-29 00:00:09 +00:00
Vyacheslav Egorov 0aa2cfd44b [gardening] Update dartk/dartkp status files to make bots green.
TBR=paulberry@google.com

Change-Id: Ic7989026ddcf8bb51f8dc637bf1c3031ed7af8ac
Reviewed-on: https://dart-review.googlesource.com/24104
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-28 09:03:12 +00:00
Morten Krogh-Jespersen 39907272f6 Remove comments from status files.
This will allow for having automatic tools to alphabetize sections and entries.

Bug:
Change-Id: Ia7b7a100ca33197c4f3b1c50c11f24873dfbc09b
Reviewed-on: https://dart-review.googlesource.com/23675
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 07:56:20 +00:00
Paul Berry a36da30529 Insert implicit downcasts for indexed assignments.
Change-Id: Ic6b5732100908fe6ce5abfc8c577e9f5ad8245b7
Reviewed-on: https://dart-review.googlesource.com/24021
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-28 01:28:06 +00:00
Paul Berry 0eefa06d14 Insert implicit downcasts for the conditions of while statements.
Change-Id: Ieb1bc13de5afb16e75ab810de35002bb3b966ea8
Reviewed-on: https://dart-review.googlesource.com/23742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-27 17:07:41 +00:00
Morten Krogh-Jespersen a9a5081e10 Remove duplicate entries in same section from status files.
If two sections are syntactically equal, they are considered same section.

The discovery of duplicate entries was perfomed by the test in the CL:
https://dart-review.googlesource.com/#/c/sdk/+/21341

All removals has been done by hand to make sure the best comment was chosen.

Bug:
Change-Id: I105f6375adc1b5f555eb7c2af7d7d1e4e1922a32
Reviewed-on: https://dart-review.googlesource.com/21340
Reviewed-by: Alexander Thomas <athom@google.com>
2017-11-27 11:07:18 +00:00
Paul Berry b47ef6bdeb Insert implicit downcasts for the conditions of assert statements.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

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

Change-Id: I0ea8fcf94728e70d92f4be771f3ca5d10c366375
Reviewed-on: https://dart-review.googlesource.com/23725
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-26 06:33:50 +00:00
Paul Berry 5ce5811216 Insert implicit downcasts for the conditions of for statements.
Change-Id: I213617cb4ea1a5c29f8a6a56f54792c59cc4e132
Reviewed-on: https://dart-review.googlesource.com/23221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-23 16:47:32 +00:00
Paul Berry 9255de668e Insert implicit downcasts for constructor initializer expressions.
Change-Id: Ic258db9c353a4a0ab33a96c3847b174937fcf9e5
Reviewed-on: https://dart-review.googlesource.com/23220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-23 16:39:28 +00:00
Paul Berry 501872471c Insert implicit downcasts for the conditions of do statements.
Change-Id: I8bfffa0796775434cea767ec9ad13cf5697812d2
Reviewed-on: https://dart-review.googlesource.com/23140
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-22 21:47:14 +00:00
Paul Berry 245340dd7f Insert implicit downcasts for the conditions of if statements.
Change-Id: I788d50dc3d95bb4652ff122a993cd092d7262c31
Reviewed-on: https://dart-review.googlesource.com/23160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-22 19:29:24 +00:00
Paul Berry 6786f1944a Insert implicit downcasts for the operands of "not" expressions.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I3d29a1058af5ba43bc2868d85de1e9d87b666ee2
Reviewed-on: https://dart-review.googlesource.com/23080
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-22 17:55:27 +00:00
Paul Berry 9693e47d89 Insert implicit downcasts for the expressions in a return or yield statement.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: Id570bf354583a3780087ffc820eefc3619573af4
Reviewed-on: https://dart-review.googlesource.com/22842
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-22 15:33:07 +00:00
Paul Berry d22b6950c1 Insert implicit downcasts for the operands of logical expressions.
Change-Id: I25a2ca31d09d3577d1d056ca156146472c999c97
Reviewed-on: https://dart-review.googlesource.com/22900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-22 04:49:28 +00:00
Paul Berry ffdae2fd4d Insert implicit downcast checks for the expressions in a map literal.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I40b4b45d5ea32dc34aee68bfe39912141e4d7d35
Reviewed-on: https://dart-review.googlesource.com/22806
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-22 01:18:38 +00:00
Paul Berry 2d00ba15b3 Insert implicit downcast checks for the expressions in a list literal.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I1a4a2eed0f7b8ebb5cab0a993d7cf26e925b9425
Reviewed-on: https://dart-review.googlesource.com/22802
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-22 00:03:56 +00:00
Paul Berry 00bf0d3136 Insert implicit downcast checks for the argument to a combiner in a compound assignment.
Change-Id: I4827013dc060f530e553b95932db8cbacebc2bfc
Reviewed-on: https://dart-review.googlesource.com/22603
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-21 20:03:31 +00:00
Paul Berry e28d041d45 Add a language_2 test of implicit downcasts in conditional expressions
Change-Id: I2f346ce2ee1cc8b6d6b61d63750b2ae909fdf456
Reviewed-on: https://dart-review.googlesource.com/22602
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-21 18:45:28 +00:00
Paul Berry a51c69c9e5 Fix kernel/precomp status files after 8cdd9d323c
A few status entries weren't updated automatically by scripts.

Change-Id: Ib30f08ca587caa99ef6955cd0b3b52abfceaa765
Reviewed-on: https://dart-review.googlesource.com/22360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-21 05:44:17 +00:00
Bob Nystrom b63f00d674 Move a batch of negative tests into multitests or runtime tests.
Change-Id: I7358e807da6b3bc8c44d7f9e76ad349b6bd9424e
Reviewed-on: https://dart-review.googlesource.com/19520
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-11-21 00:50:57 +00:00
Paul Berry 8cdd9d323c Insert implicit downcast checks for invocation arguments.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I1fa7490f6143bd6ceca80f831e0196b16c497966
Reviewed-on: https://dart-review.googlesource.com/20907
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 00:17:37 +00:00
Paul Berry 5f633852af Add a language_2 test for implicit downcasts in variable declarations.
Change-Id: I8ca6b3446895537c1fde33ae7152c9f29038f05f
Reviewed-on: https://dart-review.googlesource.com/22205
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-20 22:59:27 +00:00
Paul Berry a2109ee71c Insert implicit downcast checks for conditional expressions.
Change-Id: If5a2add32129800f14e6da03593ce6cafc173ba5
Reviewed-on: https://dart-review.googlesource.com/22100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-20 15:50:57 +00:00
Paul Berry f043446962 Insert implicit downcast checks for the RHS of variable declarations.
Tests that have begun failing due to this change are marked with a
reference to issue #31402.

Change-Id: I5be5fb6f47430d390d53d9f195b6a75ca566f8b9
Reviewed-on: https://dart-review.googlesource.com/21701
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-18 15:35:45 +00:00
Sigmund Cherem 134dd443e5 Renormalize corelib_2 dartk/dartkp sections.
Normalize the dartk sections in corelib_2.status so that our tools can process
them. Also add some documentation for others.

TBR=paulberry@google.com

Change-Id: I6f67dd0b505a22e4438a30bc7407e4d19ac75912
Reviewed-on: https://dart-review.googlesource.com/21791
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-11-18 04:17:25 +00:00
Régis Crelier f91f67a5be [VM] Emit type checks for incoming function arguments in strong mode.
Change-Id: Icd64913f0fc6ba54a0b8517bf05ae4babfae3bdc
Reviewed-on: https://dart-review.googlesource.com/19287
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-18 00:31:35 +00:00
Alexander Markov a211134136 [Tests] Update _2 tests for Dart 2.0 fixed-size integers
Also, --limit-ints-to-64-bits is enabled when running tests in _2 test
suites.

This is the re-landing of 92ebd8aefa with
fixes:

* Revert changes in pkg/dev_compiler/test/browser/language_tests.js
  and tests/language/language_dart2js.status as they describe
  'language' test suite, not 'language_2'

* Correct tests/standalone_2/io/fuzz_support.dart as file_fuzz test was
  timing out on Windows and failing on android/arm.

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

Change-Id: If9ca77fca300ddc605f17a7be39d1707e9724e25
Reviewed-on: https://dart-review.googlesource.com/21700
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-17 20:28:06 +00:00
Sigmund Cherem 31d3d2c6b3 Follow up fixes to make bots green.
TBR=paulberry@google.com

Change-Id: I8f76763e287cfc5cf2633415991cc31595f8e7d5
Reviewed-on: https://dart-review.googlesource.com/21570
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-17 05:31:43 +00:00
Sigmund Cherem bf0f604684 Normalize language_2 .status file further.
All dartk/dartkp status live in langauge_2_kernel and there is no overlap from the other files.

Change-Id: Iba6dd894829470c59d5894eb0885fb2f6d4ec02e
Reviewed-on: https://dart-review.googlesource.com/21521
Reviewed-by: Paul Berry <paulberry@google.com>
2017-11-17 01:06:20 +00:00
Alexander Markov 22218e9b9e Revert "[Tests] Update _2 tests for Dart 2.0 fixed-size integers"
This reverts commit 92ebd8aefa.

Reason: various failures on buildbots.
Change-Id: I03e877e240fdb010d1288baebc124a3e364d1025
Reviewed-on: https://dart-review.googlesource.com/21565
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-11-17 00:52:17 +00:00
Alexander Markov 92ebd8aefa [Tests] Update _2 tests for Dart 2.0 fixed-size integers
Also, --limit-ints-to-64-bits is enabled when running tests in _2 test
suites.

Change-Id: I0b75e5e6e7af78adb29401d77ff55e735781ab73
Reviewed-on: https://dart-review.googlesource.com/20960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-16 22:40:11 +00:00
Dan Rubel f6acd76f94 Add fasta parser missing operator keyword recovery
Change-Id: I940fa31a006dc088b8f4166a9e3e48bcf65a5341
Reviewed-on: https://dart-review.googlesource.com/21500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-11-16 21:28:12 +00:00
Erik Ernst f68e5231b4 Renewed tests from built_in_identifier_prefix
The test language_2/built_in_identifier_prefix_test stated 'it is not
illegal to use a built-in identifier as a library prefix', which has
been untrue for quite a while, and then proceeded to check a number of
cases where said situation was used in practice. All of that is now
obsolete, so that test was split into several tests, each of which was
adjusted to test something which is relevant today.

The new tests include checks for the use of "known" identifiers (such
as `of`, `show`, `on` and a few more) which are mentioned explicitly
in the grammar, but which are neither built-in identifiers nor
reserved words.

The new tests gave rise to a number of status entries, including 25
crashes (so it is not just "expect `MissingCompileTimeError` here
because it's not strong mode").

Note that `Function` is considered to be a built-in identifier.
This makes no difference for the grammar, but it means that there
are no cases where `Function` is used as a library prefix.

If we insist that `Function` cannot be a built-in identifier then
we just need to add a few more grammar rules to all such things as
`import .. as Function;`, but I considered it less confusing to
include `Function` among the built-in identifiers and avoid adding
support for this.

Note that we haven't said anywhere that `Function` is a built-in
identifier, so we would need to adjust an informal/*.md file to say
that, to finish this off.

Change-Id: Ifa5bbd95022498480b7ee2e94605f81cd11d9696
Reviewed-on: https://dart-review.googlesource.com/21080
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2017-11-16 12:34:14 +00:00
Sigmund Cherem 02aa8c269a Mark language_2 && !$strong as skip by design, do some initial normalization:
- specify $strong in _kernel.status
- move status entries to the file they belong to (dartk/dartkp in
  _kernel.status, none & app_jit in vm.status, dart_precompiled in
  _precompiled.status)

Later: merge sections together (many expressions are equivalent or have
conditions that might not be relevant, like $strong && $checked).
Change-Id: Ia16817c2145f002ca210a218759c36c53bbe9ba9
Reviewed-on: https://dart-review.googlesource.com/21220
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-11-15 22:17:51 +00:00
Dan Rubel 197707d999 update status files
Change-Id: If13b867986c917da979a30cae2990de455afb200
Reviewed-on: https://dart-review.googlesource.com/21281
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-15 20:53:39 +00:00
Dan Rubel ee9187027f update status file
Change-Id: If955b98f52f36ad12b14b97155cef71f898f4d5c
Reviewed-on: https://dart-review.googlesource.com/21200
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-15 18:41:10 +00:00
Régis Crelier cfdcd4d496 [kernel] update status file with newly filed issue.
Change-Id: I169f1f579c85aa439c1e6cd9330e6901f6544530
Reviewed-on: https://dart-review.googlesource.com/21181
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-15 17:39:57 +00:00
Paul Berry abe2e85d15 Report "invalid assignment" from the front end as an error rather than a warning.
The front end only detects invalid assignments during type inference,
and type inference is only done in strong mode.  In strong mode,
invalid assignment is an error.

Change-Id: I1c598716be84804e9dc109414fe45f73888ed8c0
Reviewed-on: https://dart-review.googlesource.com/20741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-14 18:39:14 +00:00
Paul Berry cc5cb89e0b Strong mode fixes for type_vm_test.dart
This test contained several instances where a dynamic downcast error
is expected in Dart 2.0.

Change-Id: I8cffd979e2b5be40c5198e161fcd2c23562e7f5c
Reviewed-on: https://dart-review.googlesource.com/20080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-13 21:16:57 +00:00
Paul Berry 5a9dd93e17 Add a test that will pass once fuzzy arrows are removed.
See also issue #29630

Change-Id: I00571858a95f0556308cef36064f406a7bd31263
Reviewed-on: https://dart-review.googlesource.com/20140
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-11 15:38:20 +00:00
Alexander Markov 0a4b151dc4 [Test tool] Pass --strong to dart_bootstrap, disable experimental opts
In '-c dartkp --strong' mode test tool should pass --strong option to
dart_bootstrap. Otherwise it uses non-strong vm_platform.dill instead
of vm_platform_strong.dill.

Also, experimental strong-mode based optimizations are disabled for now.

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

Change-Id: I2188b9165ae4daa0510e4e566393810b8165291e
Reviewed-on: https://dart-review.googlesource.com/20304
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-11 01:46:01 +00:00
Régis Crelier 1a2ba1476a [gardening] Mark a kernel strong mode test as crashing in debug mode.
Change-Id: I3a09867b191b931e37451b5368408ec2029e93fc
Reviewed-on: https://dart-review.googlesource.com/20306
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-11-11 01:13:38 +00:00