Robert Nystrom
d244eeb84c
Migrate "c" directory language tests off @compile-error.
...
The "@compile-error" comment is an old not-great way of defining static
error tests.
See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I3e10209e78e48893d2f2df7f8af7963d319efd9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296405
Reviewed-by: Jake Macdonald <jakemac@google.com >
Commit-Queue: Bob Nystrom <rnystrom@google.com >
Auto-Submit: Bob Nystrom <rnystrom@google.com >
2023-04-20 19:10:58 +00:00
Konstantin Shcheglov
3f288db57e
Issue 51046. Implement primitive equality.
...
Bug: https://github.com/dart-lang/sdk/issues/51046
Change-Id: I2190b9e36753cc5f4708597ae0b515430d2f7bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-02-18 06:22:04 +00:00
Josh Soref
17ccbecc61
Spelling tests language
...
Closes https://github.com/dart-lang/sdk/pull/50763
GitOrigin-RevId: ee6187bc11c8211402b6aa722eb2c0826cba3d5b
Change-Id: I598004024a89e25710b9f16749ffb7c6fd6753c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276340
Reviewed-by: Erik Ernst <eernst@google.com >
Commit-Queue: Erik Ernst <eernst@google.com >
2022-12-19 16:30:06 +00:00
Michael Thomsen
e4cc3c98e5
[3.0 alpha] Remove deprecated dart:core List() constructor.
...
TEST=ci
Bug: Contributes to https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic129ef2d89f625d9ec6a7a1c301cffddd60b2ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258920
Reviewed-by: Lasse Nielsen <lrn@google.com >
Commit-Queue: Michael Thomsen <mit@google.com >
Reviewed-by: Slava Egorov <vegorov@google.com >
2022-12-15 11:36:22 +00:00
Daco Harkes
3d7aacda12
[tests] Migrate away from native
...
Aggregated test results:
Pass -> CompileTimeError (expected CompileTimeError)
bug: https://github.com/dart-lang/sdk/issues/28791
Change-Id: I4de6dc405be0fe4f2acf1a073fa9ab5210e49c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266022
Reviewed-by: Tess Strickland <sstrickl@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2022-10-28 09:16:40 +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
Aske Simon Christensen
de3cec3a47
Make hashcode override test throw instead of looping indefinitely.
...
This achieves the same thing (test that `hashCode` is not called), but
avoids a costly timeout on failure. This drastically cuts down the total
testing time for the language and corelib suites for dart2wasm (which
intends not to implement a special case here, since it is going to be
illegal in the future anyway).
Change-Id: I040925ebd8271a5816c81bc16484c0a96626857d
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244061
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Lasse Nielsen <lrn@google.com >
2022-05-11 11:48:26 +00:00
Johnni Winther
2a1224f3b5
[cfe] Check primitive equals in legacy libraries
...
This enables the check for primitive equals in switch cases in
legacy libraries.
Change-Id: Iddc464f39525d5167a5c6e8c40c95acc3c245d76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231701
Reviewed-by: Joshua Litt <joshualitt@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-02-10 22:13:14 +00:00
Johnni Winther
ae4543fcb9
[cfe] Report all compile-time errors found during constant evaluation
...
Closes #46925
Change-Id: I81e97cae05c39c24b24dae82a222f857d4730ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210465
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-08-24 11:42:53 +00:00
Daco Harkes
a5d4e010af
[test] const types and null in const maps and sets
...
We were lacking tests for doing a `null` lookup in const maps and sets.
Also, we were lacking tests for having type literals with user-defined
classes in const maps and sets.
Bug: https://github.com/dart-lang/sdk/issues/45908
Change-Id: I1665420ddcc71df7b47a87ee9e16d7ebbe9e13f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208080
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
2021-07-26 12:42:20 +00:00
Sam Rawlins
ea5333a23f
Do not report const ctor with a mixed in abstract final field
...
Additionally, reduce duplicated errors regarding invalid const constructors.
Fixes https://github.com/dart-lang/sdk/issues/46641
Change-Id: Ica397ad6e28a05bc5340d5ceca236fbedf1e95f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207621
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-07-21 17:56:08 +00:00
Daco Harkes
d5a97be466
[test] Fix getValueNonOptimized in tests
...
Addressing https://dart-review.googlesource.com/c/sdk/+/206202/4/tests/language/const/set_hashcode_override2_test.dart#12
Change-Id: I08948507b702dd0885b98ae31b1a7d22536e9ce1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206224
Reviewed-by: Erik Ernst <eernst@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2021-07-12 10:23:14 +00:00
Daco Harkes
2a68e31ffb
[test] Non terminating hashCode override in const
...
The language spec only mandates operator== to not be overridden for
instances used in const maps as keys or const sets. However, hashCode
_can_ be overridden.
This adds a test that exercises this behavior.
Bug: https://github.com/dart-lang/sdk/issues/45908
Change-Id: Id64c0722872bb916963b71057a06309bf3b8b559
Cq-Include-Trybots: luci.dart.try:dart2js-csp-minified-linux-x64-chrome-try,dart2js-minified-strong-linux-x64-d8-try,dart2js-nnbd-linux-x64-chrome-try,dart2js-strong-hostasserts-linux-ia32-d8-try,dart2js-strong-linux-x64-chrome-try,dart2js-strong-linux-x64-firefox-try,dart2js-strong-mac-x64-chrome-try,dart2js-strong-mac-x64-safari-try,dart2js-strong-win-x64-chrome-try,dart2js-unit-linux-x64-release-try,ddc-linux-release-chrome-try,ddc-mac-release-chrome-try,ddc-nnbd-linux-release-chrome-try,ddc-win-release-chrome-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206085
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
2021-07-08 12:18:48 +00:00
Daco Harkes
c8c41f72a0
[test] const instances in non-const sets
...
The language spec only mandates operator== to not be overridden for
instances used in const maps as keys or const sets. However, hashCode
_can_ be overridden.
This CL adds tests that uses these const instances in non-const maps.
(As follow up of https://dart-review.googlesource.com/c/sdk/+/206085 )
Bug: https://github.com/dart-lang/sdk/issues/45908
Change-Id: I3caf5afd45aaec24b3e89e4645b00841a2075ca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206202
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2021-07-08 11:30:53 +00:00
Daco Harkes
fed3cef63a
[vm/tests] const maps are immutable
...
Bug: https://github.com/dart-lang/sdk/issues/45908
Change-Id: I15011ab63fb119a601ba5f147481f9e9aefafdd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203683
Reviewed-by: Clement Skau <cskau@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2021-06-15 14:08:52 +00:00
Leaf Petersen
b101a7d002
Add language versions to _2 test libraries
...
Change-Id: Ib33169c3e0ffc870915c189404074a1dea472546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196548
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Commit-Queue: Leaf Petersen <leafp@google.com >
2021-04-26 17:58:57 +00:00
Stephen Adams
cd2258572d
Test for avoiding exponential tree traversal of DAG constants
...
Change-Id: Ib62db28a7a6d21fe859f32f092e1096c0c166752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109160
Commit-Queue: Stephen Adams <sra@google.com >
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
2021-01-06 03:54:30 +00:00
Jens Johansen
0c90775fd6
[CFE] Better error messages for class initialization errors
...
Change-Id: Ic7c489b0bfffd05cdd71dc254db042956fd25c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161944
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-09-09 11:37:47 +00:00
Sam Rawlins
b8ce4baf7e
Remove 'checked mode' from checked_mode_compile_time_errors
...
Change-Id: I6576eb186149d540ce2dbc0e0aab7177ff4727be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-07-31 19:20:58 +00:00
Sam Rawlins
f23f450e11
Analyzer: Move CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH to compile-time
...
Many of the tests were highly redundant. Subtyping has been
consolidated, so the tests don't need to cover a dozen different ways
to subtype a class.
Change-Id: I04448790d3a74690d0edb57f15146a6c3b8f2173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156400
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-07-30 00:34:29 +00:00
Konstantin Shcheglov
8de8a1c226
Move codes from StaticTypeWarningCode into CompileTimeErrorCode.
...
They are all errors now.
Change-Id: If48d38e38e845fd5b5a950dd5514bf1cbbce03d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-27 16:44:15 +00:00
Konstantin Shcheglov
ba92b78acd
Move errors from StaticWarningCode to CompileTimeErrorCode.
...
Bug: https://github.com/dart-lang/sdk/issues/42821
Change-Id: I153c48d7a2e4a02026928e6203aacf8f2dc029ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-26 04:19:25 +00:00
Sam Rawlins
c65b444145
Analyzer: Move TOP_LEVEL_CYCLE to be a compile-time error
...
Also remove duplication with RECURSIVE_COMPILE_TIME_CONSTANT.
Also write some tests for TOP_LEVEL_CYCLE.
Change-Id: I33cb765236a83bd925f9f0c6e65ac9398761c699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-24 15:11:38 +00:00
Johnni Winther
9ab7a5edef
[cfe] Use variable name in error message for missing initializer
...
Closes #42610
Change-Id: I70a5ac9302bd6545cd5e73f2dab61a29bc6a3000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153462
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-07-08 12:45:15 +00:00
Brian Wilkerson
d074bb1596
Improve the range selected by const_constructor_with_field_initialized_by_non_const
...
Instead of highlighting the entire constructor, which might be long, we
now highlight just the keyword `const`.
Change-Id: Ie520db0a2fcaf05db79d9e49e08f06a5212fef7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152727
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-06-28 14:51:31 +00:00
Robert Nystrom
e736495eb7
Migrate language_2/const to NNBD.
...
Change-Id: I464275799b3e7a21326d35503b776f9c1101a599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141764
Commit-Queue: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
Auto-Submit: Bob Nystrom <rnystrom@google.com >
2020-04-03 00:56:36 +00:00
Johnni Winther
64dae246db
[dart2js] Use CFE constant evaluator for non-required constants
...
Change-Id: Id363332caf29e98307553ec048c2dea36c739d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129701
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2020-01-08 08:21:59 +00:00
Brian Wilkerson
877d6f745d
Improve the range selected for const_constructor_with_non_final_field
...
Change-Id: I168e92c32b581dffcad25804161b56f4d99c1dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-01-05 23:50:22 +00:00
Robert Nystrom
fc1b1ecc71
Move files under language_2 into subdirectories.
...
Change-Id: Idbcc965a27e9ffeedf5e0a1068b019de4193070f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127745
Commit-Queue: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Alexander Thomas <athom@google.com >
2019-12-11 19:18:00 +00:00