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

Side by Side Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 2320573003: Issue 26874. Don't report CAN_BE_NULL_AFTER_NULL_AWARE for members of the Null class. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.hint_code_test; 5 library analyzer.test.generated.hint_code_test;
6 6
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/error.dart'; 8 import 'package:analyzer/src/generated/error.dart';
9 import 'package:analyzer/src/generated/parser.dart'; 9 import 'package:analyzer/src/generated/parser.dart';
10 import 'package:analyzer/src/generated/source_io.dart'; 10 import 'package:analyzer/src/generated/source_io.dart';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 Source source = addSource(r''' 112 Source source = addSource(r'''
113 m(x) { 113 m(x) {
114 x?.a?.b; 114 x?.a?.b;
115 } 115 }
116 '''); 116 ''');
117 computeLibrarySourceErrors(source); 117 computeLibrarySourceErrors(source);
118 assertNoErrors(source); 118 assertNoErrors(source);
119 verify([source]); 119 verify([source]);
120 } 120 }
121 121
122 void test_canBeNullAfterNullAware_false_null() {
123 Source source = addSource(r'''
124 m(x) {
125 x?.a.hashCode;
126 x?.a.runtimeType;
127 x?.a.toString();
128 x?.b().hashCode;
129 x?.b().runtimeType;
130 x?.b().toString();
131 }
132 ''');
133 computeLibrarySourceErrors(source);
134 assertNoErrors(source);
135 verify([source]);
136 }
137
122 void test_canBeNullAfterNullAware_methodInvocation() { 138 void test_canBeNullAfterNullAware_methodInvocation() {
123 Source source = addSource(r''' 139 Source source = addSource(r'''
124 m(x) { 140 m(x) {
125 x?.a.b(); 141 x?.a.b();
126 } 142 }
127 '''); 143 ''');
128 computeLibrarySourceErrors(source); 144 computeLibrarySourceErrors(source);
129 assertErrors(source, [HintCode.CAN_BE_NULL_AFTER_NULL_AWARE]); 145 assertErrors(source, [HintCode.CAN_BE_NULL_AFTER_NULL_AWARE]);
130 verify([source]); 146 verify([source]);
131 } 147 }
(...skipping 3781 matching lines...) Expand 10 before | Expand all | Expand 10 after
3913 n() { 3929 n() {
3914 var a = m(), b = m(); 3930 var a = m(), b = m();
3915 } 3931 }
3916 }'''); 3932 }''');
3917 computeLibrarySourceErrors(source); 3933 computeLibrarySourceErrors(source);
3918 assertErrors( 3934 assertErrors(
3919 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); 3935 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]);
3920 verify([source]); 3936 verify([source]);
3921 } 3937 }
3922 } 3938 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698