mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:47:08 +00:00
Update CFE expectation for error test.
Also update the test name to follow test naming conventions (tests with error expectations are named `*_error_test.dart`), and add a copyright notice and test description. Bug: https://github.com/dart-lang/sdk/issues/52202 Change-Id: I762dcbf6ebd02190250ccdd9767e6db29cac1d61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300322 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
b9c371dbfb
commit
761b8019ef
18
tests/language/patterns/issue52202_error_test.dart
Normal file
18
tests/language/patterns/issue52202_error_test.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
// 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.
|
||||
|
||||
/// Regression test for https://github.com/dart-lang/sdk/issues/52202.
|
||||
|
||||
typedef A = int?;
|
||||
|
||||
void f(x) {
|
||||
switch (x) {
|
||||
case A(foo: 0):
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// ^
|
||||
// [cfe] The getter 'foo' isn't defined for the class 'int?'.
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
typedef A = int?;
|
||||
|
||||
void f(x) {
|
||||
switch (x) {
|
||||
case A(foo: 0):
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] unspecified
|
||||
break;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue