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

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

Issue 2814443005: Fix for summarization of generic function type aliases and support for resynthesizing. (Closed)
Patch Set: Created 3 years, 8 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/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
9 import 'package:analyzer/dart/constant/value.dart'; 9 import 'package:analyzer/dart/constant/value.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 13957 matching lines...) Expand 10 before | Expand all | Expand 10 after
13968 r''' 13968 r'''
13969 /** 13969 /**
13970 * Docs 13970 * Docs
13971 */ 13971 */
13972 typedef dynamic F(); 13972 typedef dynamic F();
13973 '''); 13973 ''');
13974 } 13974 }
13975 } 13975 }
13976 13976
13977 test_typedef_generic() { 13977 test_typedef_generic() {
13978 checkLibrary( 13978 var library = checkLibrary(
13979 'typedef F<T> = Function<S>(List<S> list, Function<A>(A), T);'); 13979 'typedef F<T> = int Function<S>(List<S> list, num Function<A>(A), T);');
13980 if (isStrongMode) {
13981 checkElementText(
13982 library,
13983 r'''
13984 typedef F<T> = int Function<S>(List<S> list, <A>(A) → num , T );
13985 ''');
13986 } else {
13987 checkElementText(
13988 library,
13989 r'''
13990 typedef F<T> = int Function<S>(List<S> list, <A>(A) → num , T );
13991 ''');
13992 }
13993 }
13994
13995 test_typedef_generic_asFieldType() {
13996 shouldCompareLibraryElements = false;
13997 var library = checkLibrary(r'''
13998 typedef Foo<S> = S Function<T>(T x);
13999 class A {
14000 Foo<int> f;
14001 }
14002 ''');
14003 if (isStrongMode) {
14004 checkElementText(
14005 library,
14006 r'''
14007 typedef Foo<S> = S Function<T>(T x);
14008 class A {
14009 <T>(T) → int f;
14010 }
14011 ''');
14012 } else {
14013 checkElementText(
14014 library,
14015 r'''
14016 typedef Foo<S> = S Function<T>(T x);
14017 class A {
14018 <T>(T) → int f;
14019 }
14020 ''');
14021 }
13980 } 14022 }
13981 14023
13982 test_typedef_parameter_parameters() { 14024 test_typedef_parameter_parameters() {
13983 var library = checkLibrary('typedef F(g(x, y));'); 14025 var library = checkLibrary('typedef F(g(x, y));');
13984 if (isStrongMode) { 14026 if (isStrongMode) {
13985 checkElementText( 14027 checkElementText(
13986 library, 14028 library,
13987 r''' 14029 r'''
13988 typedef dynamic F((dynamic, dynamic) → dynamic g); 14030 typedef dynamic F((dynamic, dynamic) → dynamic g);
13989 '''); 14031 ''');
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
15149 fail('Unexpectedly tried to get unlinked summary for $uri'); 15191 fail('Unexpectedly tried to get unlinked summary for $uri');
15150 } 15192 }
15151 return serializedUnit; 15193 return serializedUnit;
15152 } 15194 }
15153 15195
15154 @override 15196 @override
15155 bool hasLibrarySummary(String uri) { 15197 bool hasLibrarySummary(String uri) {
15156 return true; 15198 return true;
15157 } 15199 }
15158 } 15200 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/element_text.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