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

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

Issue 1052243002: Implement the new '??=' operator in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 019c07eff67ade35090dadeaca0d3567ce30a1ce..02eca6e174b7399266ec1b10e455e0a409126d9a 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -355,6 +355,21 @@ main() {
verify([source]);
}
+ void test_invalidAssignment_ifNullAssignment() {
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+ options.enableNullAwareOperators = true;
+ resetWithOptions(options);
+ Source source = addSource('''
+void f(int i) {
+ double d;
+ d ??= i;
+}
+''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+ verify([source]);
+ }
+
void test_invalidAssignment_instanceVariable() {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | tests/language/if_null_assignment_behavior_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698