mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:42:11 +00:00
[tests] Add language test for field accesses on constant-like record.
Change-Id: I4748f14fd77e4422823af2b7e60d61a57339e19c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291641 Commit-Queue: Nate Biggs <natebiggs@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
parent
7c0e4d67c7
commit
f9fba691ea
15
tests/language/regress/regress51883_test.dart
Normal file
15
tests/language/regress/regress51883_test.dart
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=records
|
||||
|
||||
// Verifies that constant-like records are correctly simplified into a constant
|
||||
// record by the backends who perform such optimizations.
|
||||
//
|
||||
// Regression test for https://github.com/dart-lang/sdk/issues/51883.
|
||||
|
||||
void main() {
|
||||
final x = ([1, 2], 3);
|
||||
(x.$1).add(4);
|
||||
}
|
Loading…
Reference in a new issue