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

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

Issue 1763013003: Fix method inference crasher (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/lib/src/task/strong_mode.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 7f80ef3dd2c97de5b519581b00e0bd87393c9472..9f75d5dbdf85208b1f3cfa54df7bf02fd7c31957 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1714,7 +1714,6 @@ main() {
''');
});
-
test('inferred generic instantiation', () {
checkFile('''
import 'dart:math' as math;
@@ -1836,6 +1835,22 @@ main() {
''');
});
+ // Regression test for crash when adding genericity
+ test('handle override of non-generic with generic', () {
+ checkFile('''
+class C {
+ m(x) => x;
+}
+class D extends C {
+ /*=T*/ m/*<T>*/(/*=T*/ x) => x;
Jennifer Messerly 2016/03/06 20:20:19 do/should we also have test cases for when the par
Leaf 2016/03/07 18:40:28 Yes, there's one above ("infer generic method type
+}
+main() {
+ int y = /*info:DYNAMIC_CAST*/(new D() as C).m(42);
+ print(y);
+}
+ ''');
+ });
+
test('correctly recognize generic upper bound', () {
// Regression test for https://github.com/dart-lang/sdk/issues/25740.
checkFile(r'''
@@ -1893,7 +1908,6 @@ void functionExpressionInvocation() {
}
''');
});
-
});
// Regression test for https://github.com/dart-lang/dev_compiler/issues/47
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698