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

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

Issue 1663533002: fixes #25640, errors on function downcasts when we know it's an exact type (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/src/task/strong/checker_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/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index eccb4f28fc5079f4d3a8f3e4a597806aa535ab6e..718ec2a20392956d6f2116b11364843a0ae7230a 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1611,9 +1611,8 @@ main() {
takeOOI(/*severe:STATIC_TYPE_ERROR*/math.max);
takeIDI(/*severe:STATIC_TYPE_ERROR*/math.max);
takeDID(/*severe:STATIC_TYPE_ERROR*/math.max);
-
- takeOON(/*warning:DOWN_CAST_COMPOSITE*/math.max);
- takeOOO(/*warning:DOWN_CAST_COMPOSITE*/math.max);
+ takeOON(/*severe:STATIC_TYPE_ERROR*/math.max);
+ takeOOO(/*severe:STATIC_TYPE_ERROR*/math.max);
// Also test SimpleIdentifier
takeIII(min);
@@ -1629,9 +1628,8 @@ main() {
takeOOI(/*severe:STATIC_TYPE_ERROR*/min);
takeIDI(/*severe:STATIC_TYPE_ERROR*/min);
takeDID(/*severe:STATIC_TYPE_ERROR*/min);
-
- takeOON(/*warning:DOWN_CAST_COMPOSITE*/min);
- takeOOO(/*warning:DOWN_CAST_COMPOSITE*/min);
+ takeOON(/*severe:STATIC_TYPE_ERROR*/min);
+ takeOOO(/*severe:STATIC_TYPE_ERROR*/min);
// Also PropertyAccess
takeIII(new C().m);
@@ -1648,6 +1646,8 @@ main() {
takeIDI(/*severe:STATIC_TYPE_ERROR*/new C().m);
takeDID(/*severe:STATIC_TYPE_ERROR*/new C().m);
+ // Note: this is a warning because a downcast of a method tear-off could work
+ // (derived method can be a subtype).
takeOON(/*warning:DOWN_CAST_COMPOSITE*/new C().m);
takeOOO(/*warning:DOWN_CAST_COMPOSITE*/new C().m);
}
« no previous file with comments | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698