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

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

Issue 1427783003: Check for potential null operand in Not expressions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index a74a1d6e85d514da8fe7a67cbb815e00bcc84120..6ed5d4cb199d9d63b6540c727561df51c7ecb80a 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -2762,10 +2762,10 @@ f(A a) {
verify([source]);
}
- void test_deprecatedAnnotationUse_Deprecated() {
+ void test_deprecatedAnnotationUse_deprecated() {
Source source = addSource(r'''
class A {
- @Deprecated('0.9')
+ @deprecated
m() {}
n() {m();}
}''');
@@ -2774,10 +2774,10 @@ class A {
verify([source]);
}
- void test_deprecatedAnnotationUse_deprecated() {
+ void test_deprecatedAnnotationUse_Deprecated() {
Source source = addSource(r'''
class A {
- @deprecated
+ @Deprecated('0.9')
m() {}
n() {m();}
}''');
@@ -3274,6 +3274,17 @@ m(x) {
verify([source]);
}
+ void test_nullAwareInCondition_if_not() {
+ Source source = addSource(r'''
+m(x) {
+ if (!x?.a) {}
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [HintCode.NULL_AWARE_IN_CONDITION]);
+ verify([source]);
+ }
+
void test_nullAwareInCondition_if_parenthesized() {
Source source = addSource(r'''
m(x) {
« 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