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

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

Issue 1578863004: fixes #24711, allow factory constructors to be downcast (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/info.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..6ad253d590f04015b557d3b6ce8703d7743e5dd0 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -1141,6 +1141,21 @@ void main() {
'''
});
+ testChecker('factory constructor downcast', {
+ '/main.dart': r'''
+ class Animal {
+ Animal();
+ factory Animal.cat() => return new Cat();
+ }
+
+ class Cat extends Animal {}
+
+ void main() {
+ Cat c = /*info:ASSIGNMENT_CAST*/new Animal.cat();
+ c = /*severe:STATIC_TYPE_ERROR*/new Animal();
+ }'''
+ });
+
testChecker('field/field override', {
'/main.dart': '''
class A {}
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/info.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698