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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 1575173005: checking and inference of null coalescing operator, fixes #24564 and fixes #25387 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.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/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 46d99db78ac57da85a0d7f6e547a964c795ca233..55b73a8a4282ac48d6070ddf0b8b6ba601f44a9d 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -1493,6 +1493,23 @@ void main() {
'''
});
+ testChecker('null coalescing operator', {
+ '/main.dart': '''
+ class A {}
+ class C<T> {}
+ main() {
+ A a, b;
+ a ??= new A();
+ b = b ?? new A();
+
+ // downwards inference
+ C<int> c, d;
+ c ??= /*info:INFERRED_TYPE_ALLOCATION*/new C();
+ d = d ?? /*info:INFERRED_TYPE_ALLOCATION*/new C();
+ }
+ '''
+ });
+
testChecker('compound assignments', {
'/main.dart': '''
class A {
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698