Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1420)

Unified Diff: pkg/analyzer/test/generated/static_type_warning_code_test.dart

Issue 2638183002: Issue 28027. Move Null to the bottom in the Analyzer. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/generated/static_type_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index 4290c02d337a7bc50ea1b38f18736007d52b4570..1825c3cc039f672767d3c7652e65fc8c09f88a5f 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -1066,17 +1066,6 @@ f(B<A> b) {}''',
[StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
}
- test_returnOfInvalidType_async_future_int_mismatches_future_null() async {
- await assertErrorsInCode(
- '''
-import 'dart:async';
-Future<Null> f() async {
- return 5;
-}
-''',
- [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- }
-
test_returnOfInvalidType_async_future_int_mismatches_future_string() async {
await assertErrorsInCode(
'''
@@ -1928,6 +1917,19 @@ f(Object o) {
[StaticTypeWarningCode.UNDEFINED_METHOD]);
}
+ test_undefinedMethod_ofNull() async {
+ // TODO(scheglov) Track https://github.com/dart-lang/sdk/issues/28430 to
+ // decide whether a warning should be reported here.
+ await assertErrorsInCode(
+ r'''
+Null f(int x) => null;
+main() {
+ f(42).abs();
+}
+''',
+ [StaticTypeWarningCode.UNDEFINED_METHOD]);
+ }
+
test_undefinedMethod_private() async {
addNamedSource(
"/lib.dart",
« no previous file with comments | « pkg/analyzer/test/generated/static_type_analyzer_test.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698