Files
sdk/pkg/analyzer/test/generated/static_warning_code_test.dart
T
Paul Berry f2123a8f7c [analyzer] Rename error constants to camelCase.
This change was generated by the following process:

- The script `pkg/analyzer/tool/messages/rename_error_constants.dart`
  was run. This generated the vast majority of the diffs.

- Then all modified files were reformatted using
  `tools/sdk/dart-sdk/bin/dart/format`.

- Finally, the script `pkg/analyzer/tool/messages/generate.dart` was
  run, to rebuild generated code.

Change-Id: I6a6a69644ed8740ad6269d98cb169076151824ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-08-13 22:02:42 -07:00

56 lines
1.4 KiB
Dart

// Copyright (c) 2014, 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.
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../src/dart/resolution/context_collection_resolution.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(StaticWarningCodeTest);
});
}
@reflectiveTest
class StaticWarningCodeTest extends PubPackageResolutionTest {
// TODO(brianwilkerson): Figure out what to do with the rest of these tests.
// The names do not correspond to diagnostic codes, so it isn't clear what
// they're testing.
test_nonAbstractClassInheritsAbstractMemberOne_ensureCorrectFunctionSubtypeIsUsedInImplementation() async {
// 15028
await assertErrorsInCode(
'''
class C {
foo(int x) => x;
}
abstract class D {
foo(x, [y]);
}
class E extends C implements D {}''',
[error(CompileTimeErrorCode.invalidImplementationOverride, 73, 1)],
);
}
test_typePromotion_functionType_arg_InterToDyn() async {
await assertNoErrorsInCode('''
typedef FuncDyn(x);
typedef FuncA(A a);
class A {}
class B {}
f(FuncA f) {
if (f is FuncDyn) {
f(new B());
}
}''');
}
test_voidReturnForGetter() async {
await assertNoErrorsInCode('''
class S {
void get value {}
}''');
}
}