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

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

Issue 1635213003: Test some additional corner cases of type inference for summaries. (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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 addLibrary('dart:async'); 1221 addLibrary('dart:async');
1222 checkLibrary('import "dart:async" show Future, Stream; Future f;'); 1222 checkLibrary('import "dart:async" show Future, Stream; Future f;');
1223 } 1223 }
1224 1224
1225 test_imports() { 1225 test_imports() {
1226 addLibrarySource('/a.dart', 'library a; class C {}'); 1226 addLibrarySource('/a.dart', 'library a; class C {}');
1227 addLibrarySource('/b.dart', 'library b; class D {}'); 1227 addLibrarySource('/b.dart', 'library b; class D {}');
1228 checkLibrary('import "a.dart"; import "b.dart"; C c; D d;'); 1228 checkLibrary('import "a.dart"; import "b.dart"; C c; D d;');
1229 } 1229 }
1230 1230
1231 test_inferred_type_is_typedef() {
1232 checkLibrary('typedef int F(String s);'
1233 ' class C extends D { var v; }'
1234 ' abstract class D { F get v; }');
1235 }
1236
1237 test_inferred_type_refers_to_bound_type_param() {
1238 checkLibrary('class C<T> extends D<int, T> { var v; }'
1239 ' abstract class D<U, V> { Map<V, U> get v; }');
1240 }
1241
1242 test_inferred_type_via_function_typed_param() {
1243 if (options.strongMode) {
1244 // TODO(paulberry): get this test to pass.
1245 return;
1246 }
1247 checkLibrary('class C extends D { f(g) {} }'
1248 ' abstract class D { void f(int g(String)); }');
1249 }
1250
1231 test_library() { 1251 test_library() {
1232 checkLibrary(''); 1252 checkLibrary('');
1233 } 1253 }
1234 1254
1235 test_library_documented() { 1255 test_library_documented() {
1236 checkLibrary(''' 1256 checkLibrary('''
1237 // Extra comment so doc comment offset != 0 1257 // Extra comment so doc comment offset != 0
1238 /** 1258 /**
1239 * Docs 1259 * Docs
1240 */ 1260 */
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 fail('Unexpectedly tried to get unlinked summary for $uri'); 1751 fail('Unexpectedly tried to get unlinked summary for $uri');
1732 } 1752 }
1733 return serializedUnit; 1753 return serializedUnit;
1734 } 1754 }
1735 1755
1736 @override 1756 @override
1737 bool hasLibrarySummary(String uri) { 1757 bool hasLibrarySummary(String uri) {
1738 return true; 1758 return true;
1739 } 1759 }
1740 } 1760 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698