Commit graph

34 commits

Author SHA1 Message Date
Mayank Patke e78c0cf7a0 Remove language tests that opt out of null safety
Change-Id: I17409423f04f2eddebd4f20fd613cbcc9164dca5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347860
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-01-23 18:23:32 +00:00
Paul Berry 1de6bc74d2 Restore mixed-mode language tests.
This change reverts https://dart-review.googlesource.com/c/sdk/+/341020.

The reverted CL removed tests from `tests/language` that contained
legacy code (code with a language version less than 2.12). The primary
purpose of the removal was to unblock removal of legacy support from
the analyzer. It seemed safe to do because legacy code isn't supported
anymore, and no legacy code exists in google3 anymore. However,
several of those tests exercised important "weak mode" runtime
semantics of the web and VM platforms. See discussion at
https://dart-review.googlesource.com/c/sdk/+/341020/comments/bce31aa1_f5392ce1
for details.

This CL restores the deleted tests. Fortunately, since all the
restored tests are annotated with `Requirements=nnbd-weak`, they will
be skipped on the analyzer (thanks to
https://dart-review.googlesource.com/c/sdk/+/342080), so restoring
them no longer gets in the way of removing legacy support from the
analyzer.

Change-Id: Ib828be76f5c7eaeecaad0b7e7f7b0e3ff2f4bdb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342090
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-12-19 13:50:18 +00:00
Chloe Stefantsova c6c6c09819 [cfe] Break cycles in cyclic typedefs during the check for it
This CL breaks the dependency cycles in typedefs, allowing the
subsequent phases of compilation to rely on typdefs no longer being cyclic.

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

Change-Id: Id5e2d579c65019ad7072913ccf586ea2a1963ef9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2023-12-14 10:43:36 +00:00
Paul Berry 454fe543ef Remove mixed-mode language tests.
Now that we no longer need to support legacy (pre-2.12) code in
google3, we don't need to test our support for it either.

Most of our language tests for legacy code were in `tests/language_2`
and have already been deleted; this CL addresses the few tests that
remain in `tests/language`, mostly dealing with "mixed mode" scenarios
(i.e., interactions between legacy code and null safe code).

Change-Id: I023d84547fdf17fb0599c82fbeb4fd07252ccf0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341020
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-12-12 18:04:05 +00:00
Chloe Stefantsova 2d0e056672 [cfe] Check for cyclic typedefs at declare site instead of use site
Change-Id: I3738cd483b6436c630669edd6975b0fbb078d058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339941
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-12-06 16:11:42 +00:00
Konstantin Shcheglov f90c3d0423 Issue 52272. Report DEPRECATED_MIXIN_FUNCTION in more places.
Bug: https://github.com/dart-lang/sdk/issues/52272
Change-Id: I02133f8685adf6a1e4fa16288948cc31afeb1bd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-05-05 20:02:28 +00:00
Lasse R.H. Nielsen cc736dfb65 [flip-modifiers]: Reapply "Enforce current library restrictions."
This reapplies commit 0c05e33836
and reverts the revert 029e0cec71.

Tested: Added few new tests, updated existing. Mainly regression testing.
CoreLibraryReviewExempt: Reviewed in original CL.
Change-Id: Ifcc79ce2f9375f607722643a04957b0961e6c295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284304
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 09:37:38 +00:00
Jake Macdonald 3643e771c4 [flip-modifiers] opt out from class modifiers some failing front end language tests
Change-Id: I7c6473b2c1dd401355b18b55c8d3ce9b0cfaf257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286541
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-03-02 20:40:20 +00:00
Jake Macdonald bc3a4a660f pre-emptively fix some tests for class modifiers flag flip
Change-Id: Ie7bbea5faa07dcc41f551268bd730bf0416e1fef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286280
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-03-01 20:11:25 +00:00
Jake Macdonald 41bc0b4d07 opt assignable_expression_test into 2.19
opt switch related tests back to 2.19
opt map/set hashCode override tests back to 2.19

Change-Id: Ib5c44fc17de43eaf9bcad71d7a326c5fcbff02bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285800
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-02-27 22:48:51 +00:00
Ilya Yanok 029e0cec71 Revert "Enforce current library restrictions."
This reverts commit 0c05e33836.

Reason for revert: breaks ~10% of G3 smoke suite.

Original change's description:
> Enforce current library restrictions.
>
> Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
> Mark all current classes intended as mixins as `mixin class`.
>
> More additions and cleanup will follow,
> but this change should make everything keep working as today
> if we flip the switch.
>
> TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.
>
> Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Kallen Tu <kallentu@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ib0cb5b7ec1a8c392bbf9bf4af8dc3efc0b27991d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284187
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-20 15:29:41 +00:00
Lasse R.H. Nielsen 0c05e33836 Enforce current library restrictions.
Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
Mark all current classes intended as mixins as `mixin class`.

More additions and cleanup will follow,
but this change should make everything keep working as today
if we flip the switch.

TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.

Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-02-18 12:37:40 +00:00
Paul Berry 54906759b9 Don't delegate foreign private names to noSuchMethod.
If a concrete class implements an interface containing a name that's
private to a different library, any attempt to invoke that name will
result in an exception getting thrown.  Previously, such attempts
would result in the call being diverted to noSuchMethod.

This change closes a loophole in Dart's privacy system, and paves the way for
a future implementation of promotion for private final fields (see
https://github.com/dart-lang/language/issues/2020).

Bug: https://github.com/dart-lang/sdk/issues/49687
Change-Id: Ie55805e0fc77dc39713761a80a42c28bd0504722
Tested: language tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255640
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-09-27 21:20:35 +00:00
Anis Alibegić 40e18905f2 Fixed various typos in a lot of files
Closes https://github.com/dart-lang/sdk/pull/49478

TEST=Manual

GitOrigin-RevId: f4c9c6869dfe73639295e86574a021523b3d374d
Change-Id: I134a97caed4eec59d70e9cbca16b7e9a472cf2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251902
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-07-25 12:21:59 +00:00
Ahmed Ashour 85700570f6 Fix typos
Fixes #49241

TEST=ci

Change-Id: I6117bf816fc8c4613cce66927f952fef75632725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248120
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-15 11:08:28 +00:00
Lasse R.H. Nielsen 2360783808 Expire experiments released in earlier stable versions.
Remove messages referring to expired `non-nullable` experiment.
Remove occurrences of --enable-experiment with expired experiments.

TEST=Flags were expired. If existing tests still run, it's a success.

Change-Id: Id66d78eb0a3191ec5e31375faf0effd9ea7b768f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219789
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-11-11 08:28:31 +00:00
Johnni Winther b3af778a38 [cfe] Add UnresolvedKind for fine grained unresolved reporting
- including tests for issues 46719 and 46887

Change-Id: I601fcfcb956e059f502cbece29fb2a6a00f68846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-25 09:51:54 +00:00
Dmitry Stefantsov d3c3e92740 [cfe] Add error on misplaced type arguments in constructor tear-offs
Closes #46890.

Bug: https://github.com/dart-lang/sdk/issues/46890
Change-Id: Idf0c4e5ef6380541aaccba9f74755572b2fa9549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210460
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-23 14:36:47 +00:00
Robert Nystrom f462c16326 Fix import in "infer_aliased_factory_invocation_07_test.dart".
Change-Id: I8a3bfaf56715cd2971e2cbba763a998f86dd3bba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201228
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 09:46:20 +00:00
Ben Konyi d7ccc3ca6a Revert "Fix orphaned files in tests/language/ and tests/language_2/."
This reverts commit 1989b7f376.

Reason for revert: Bots are sad, red, and purple

Original change's description:
> Fix orphaned files in tests/language/ and tests/language_2/.
>
> Some of these should be tests but were missing "_test". Others seemed
> to simply be dead code. Some should have been referenced but there were
> mistakes in the imports in other files.
>
> Change-Id: If6f1d9e52a4babbf9883ddd437fc3091179f2ef2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198141
> Auto-Submit: Bob Nystrom <rnystrom@google.com>
> Commit-Queue: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

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

Change-Id: I8d63af684023e99849addf9d1c3f87d6bcfbe89d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200531
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-05-18 21:28:01 +00:00
Brian Wilkerson 06638483e1 Improve the highlight range for conflicting_generic_interfaces
Change-Id: I4ec19c1ceba747f5f23f7c95462de323fe76ecf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200240
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-18 20:42:33 +00:00
Robert Nystrom 1989b7f376 Fix orphaned files in tests/language/ and tests/language_2/.
Some of these should be tests but were missing "_test". Others seemed
to simply be dead code. Some should have been referenced but there were
mistakes in the imports in other files.

Change-Id: If6f1d9e52a4babbf9883ddd437fc3091179f2ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198141
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-18 00:36:52 +00:00
Lasse R.H. Nielsen 46ceec41d2 Remove references to enabled nonfunction-type-aliases experiment.
Change-Id: I0cfd2ad9e59c985f632d7038a64d903f6b472dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199480
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-05-17 13:17:20 +00:00
Leaf Petersen 0fa7878d56 Second batch of private name tests.
Additional tests for private classes exported via a public typedef.

Change-Id: I443b1e32efa6140f319e9acc8c498bb9f5e3d27d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193828
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-07 01:09:09 +00:00
Leaf Petersen 4162c560f0 Initial batch of private name tests.
Tests for using a private class from another library exposed via a
public typedef name.

Change-Id: I1b40958d73bc7b4c16bd013eca721b52ee4d4503
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193642
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-03-31 10:42:03 +00:00
Erik Ernst 6db2f7a2f6 Correct implementation of expand-to-type-variable error check
Bug: #45351
Change-Id: I0f7a813c8da8ce2f60cdcd3d81d854e75556130f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192743
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-25 16:28:34 +00:00
Erik Ernst 97e8837f12 Reorganize language/nonfunction_type_aliases/mixed/aliased_cyclic*
This test failed because it had a test outcome expectation comment in
a library which is not the entry point (cf. #44990). This CL changes
the test such that said comment is located in the entry point. The
trade-off is that this test now has a "reverse" import: A library
with null safety enabled imports a legacy library (but, apparently,
this does not cause the test to fail).

PS: This means that we don't have a test that will go green when #44990 is resolved.

Change-Id: Ie94bff22ce75bd662752c5814917e141fafc72ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191365
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-03-17 07:39:21 +00:00
Erik Ernst 822d353256 Update non-function type alias tests
The non-function type alias feature will no longer be supported in
legacy code. This CL moves all the tests on this topic in language_2
to language/nonfunction_type_aliases/mixed. This CL also splits each
of the tests in a legacy part (with @dart and Requirements) and a part
with null safety (containing the non-function type alias declarations
and a bit of code that it depends on), such that we are testing that
non-function type aliases can be used in mixed-version programs, as
long as they are declared in an opted-in library.

Change-Id: Ie1ba3511c95f48d98f6ed7ed56e362895b9d3b19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184460
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-02-23 16:28:20 +00:00
Konstantin Shcheglov e991bac5a2 Fix one more test with factory redirect to abstract class.
Same as https://dart-review.googlesource.com/c/sdk/+/175361

Change-Id: I0f6b9032e4f2718bceb00010080bc5ca0835a761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-10 23:49:18 +00:00
Konstantin Shcheglov 81d3244a8c Remove invalid factory constructors redirecting to abstract class.
According to the specification:
Otherwise, it is a compile-time error if R
denotes a generative constructor and D is abstract.

Not sure why we have these constructors at al.

Change-Id: I0ec671245c9b482c6455f7f5725b83db63b3c9db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-12-09 19:41:30 +00:00
Paul Berry f0052ef52e Add cycle detection test cases for nonfunction type aliases.
Change-Id: I4375c3374ba5d51b4431dbe22a0e8c867a4eb03d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167720
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-16 23:13:42 +00:00
Erik Ernst 41c9fb6a19 [CFE] Type infer aliased factory invocations.
This CL adds support for type inference on type aliased invocations of
factory constructors, redirected as well as non-redirected, and it adds
some tests using this feature.

Additionally, this CL resolves a couple of issues that arose when the
directory nonfunction_type_aliases was migrated to null-safety (by
means of two single line fixes, in 'usage*_test.dart').

Still missing: The shadow nodes should be eliminated in
_unaliasTypeAliasedConstructorInvocations and
_unaliasTypeAliasedFactoryInvocations, this will be done in a separate
CL.

Change-Id: Ic146bd16a02ca8f79c46b7df7c8dff7712f21189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152740
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-01 07:19:08 +00:00
Robert Nystrom 1ab82dee7e Migrate language_2/nonfunction_type_aliases to NNBD.
Change-Id: I2cf8ebe11b86549488fa04f18d5e92c1bf9c3a15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152585
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-06-26 18:28:55 +00:00
Erik Ernst 626639f11f Added nonfunction-type-alias tests, skipped for non-fasta compiler
Change-Id: I89ed80c973c5f2c76d534fcbd0f16d8141869757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125601
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-11-19 13:46:44 +00:00