dart-sdk/tests/language/record_type_problems_test.dart
Chloe Stefantsova 9f75d4426e [tests] Split out tests involving Record.empty
This is needed because the Record.empty constant isn't implemented
yet, to avoid compile-time errors in tests that don't expect any.

Change-Id: Ic7e61fb285a65a5809979e4c32b632f73f9e2d88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260107
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-09-21 08:05:47 +00:00

18 lines
698 B
Dart

// Copyright (c) 2022, 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
main() {
(int, int, {/*missing*/}) r1 = (1, 2);
// ^
// [analyzer] SYNTACTIC_ERROR.EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST
// [cfe] Record type named fields list can't be empty.
(int /* missing trailing comma */ ) r2 = (1, );
// ^
// [analyzer] SYNTACTIC_ERROR.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA
// [cfe] Record type with one entry requires a trailing comma.
}