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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1643403002: Test and fix a few more corner cases of summarizing type inference. (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.src.serialization.elements_test; 5 library test.src.serialization.elements_test;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/src/dart/element/element.dart'; 9 import 'package:analyzer/src/dart/element/element.dart';
10 import 'package:analyzer/src/dart/element/type.dart'; 10 import 'package:analyzer/src/dart/element/type.dart';
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 checkLibrary('typedef int F(String s);' 1494 checkLibrary('typedef int F(String s);'
1495 ' class C extends D { var v; }' 1495 ' class C extends D { var v; }'
1496 ' abstract class D { F get v; }'); 1496 ' abstract class D { F get v; }');
1497 } 1497 }
1498 1498
1499 test_inferred_type_refers_to_bound_type_param() { 1499 test_inferred_type_refers_to_bound_type_param() {
1500 checkLibrary('class C<T> extends D<int, T> { var v; }' 1500 checkLibrary('class C<T> extends D<int, T> { var v; }'
1501 ' abstract class D<U, V> { Map<V, U> get v; }'); 1501 ' abstract class D<U, V> { Map<V, U> get v; }');
1502 } 1502 }
1503 1503
1504 test_inferred_type_refers_to_function_typed_parameter_type_generic_class() {
1505 checkLibrary('class C<T, U> extends D<U, int> { void f(int x, g) {} }'
1506 ' abstract class D<V, W> { void f(int x, W g(V s)); }');
1507 }
1508
1509 test_inferred_type_refers_to_function_typed_parameter_type_other_lib() {
1510 addLibrarySource(
1511 '/a.dart', 'import "b.dart"; abstract class D extends E {}');
1512 addLibrarySource(
1513 '/b.dart', 'abstract class E { void f(int x, int g(String s)); }');
1514 checkLibrary('import "a.dart"; class C extends D { void f(int x, g) {} }');
1515 }
1516
1504 test_inferred_type_refers_to_method_function_typed_parameter_type() { 1517 test_inferred_type_refers_to_method_function_typed_parameter_type() {
1505 checkLibrary('class C extends D { void f(int x, g) {} }' 1518 checkLibrary('class C extends D { void f(int x, g) {} }'
1506 ' abstract class D { void f(int x, int g(String s)); }'); 1519 ' abstract class D { void f(int x, int g(String s)); }');
1507 } 1520 }
1508 1521
1509 test_inferred_type_refers_to_setter_function_typed_parameter_type() { 1522 test_inferred_type_refers_to_setter_function_typed_parameter_type() {
1510 checkLibrary('class C extends D { void set f(g) {} }' 1523 checkLibrary('class C extends D { void set f(g) {} }'
1511 ' abstract class D { void set f(int g(String s)); }'); 1524 ' abstract class D { void set f(int g(String s)); }');
1512 } 1525 }
1513 1526
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 fail('Unexpectedly tried to get unlinked summary for $uri'); 2043 fail('Unexpectedly tried to get unlinked summary for $uri');
2031 } 2044 }
2032 return serializedUnit; 2045 return serializedUnit;
2033 } 2046 }
2034 2047
2035 @override 2048 @override
2036 bool hasLibrarySummary(String uri) { 2049 bool hasLibrarySummary(String uri) {
2037 return true; 2050 return true;
2038 } 2051 }
2039 } 2052 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698