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

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

Issue 1585323003: fix #25486, promote from dynamic in strong mode (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/test/generated/resolver_test.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 a4878c66987c8484c0f28527f06359303373604c..d8fb80c7ac9a4fadd0aab612139a1d907e50e774 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -1432,6 +1432,25 @@ void main() {
'''
});
+ testChecker('type promotion from dynamic', {
+ '/main.dart': r'''
+ f() {
+ dynamic x;
+ if (x is int) {
+ int y = x;
+ String z = /*severe:STATIC_TYPE_ERROR*/x;
+ }
+ }
+ g() {
+ Object x;
+ if (x is int) {
+ int y = x;
+ String z = /*severe:STATIC_TYPE_ERROR*/x;
+ }
+ }
+ '''
+ });
+
testChecker('unary operators', {
'/main.dart': '''
class A {
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698