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

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

Issue 2712913004: Work around the problem when type inference fails and StrongTypeSystemImpl.inferGenericFunctionCall… (Closed)
Patch Set: Created 3 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/summary/link.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 65686c5511a6f7227aec225fda3d709d1a2e82d8..35c31afc740412c2d9a0cfe268df11b4542fa5aa 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -696,6 +696,26 @@ main() {
'C<dynamic>');
}
+ test_constructors_inferFromArguments_argumentNotAssignable() async {
+ var unit = await checkFileElement('''
+class A {}
+
+typedef T F<T>();
+
+class C<T extends A> {
+ C(F<T> f);
+}
+
+class NotA {}
+NotA myF() => null;
+
+var V = /*info:INFERRED_TYPE_ALLOCATION*/new
+ /*error:COULD_NOT_INFER*/C(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/myF);
+''');
+ var vars = unit.topLevelVariables;
+ expect(vars[0].type.toString(), 'C<A>');
+ }
+
test_constructors_inferFromArguments_const() async {
var unit = await checkFileElement('''
class C<T> {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698