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

Side by Side Diff: pkg/analyzer/test/generated/non_error_resolver_test.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.test.generated.non_error_resolver_test; 5 library analyzer.test.generated.non_error_resolver_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 class A { 2151 class A {
2152 noSuchMethod(inv) {} 2152 noSuchMethod(inv) {}
2153 } 2153 }
2154 class B extends A implements Function { 2154 class B extends A implements Function {
2155 }'''); 2155 }''');
2156 await computeAnalysisResult(source); 2156 await computeAnalysisResult(source);
2157 assertNoErrors(source); 2157 assertNoErrors(source);
2158 verify([source]); 2158 verify([source]);
2159 } 2159 }
2160 2160
2161 test_genericTypeAlias_fieldAndReturnType() async { 2161 test_genericTypeAlias_fieldAndReturnType_noTypeParameters() async {
2162 Source source = addSource(r''' 2162 Source source = addSource(r'''
2163 typedef Foo = int Function<T>(T x); 2163 typedef Foo = int Function<T>(T x);
2164 int foo<T>(T x) => 3; 2164 int foo<T>(T x) => 3;
2165 Foo bar() => foo; 2165 Foo bar() => foo;
2166 void test1() { 2166 void test1() {
2167 bar()<String>("hello"); 2167 bar()<String>("hello");
2168 } 2168 }
2169 2169
2170 class A { 2170 class A {
2171 Foo f; 2171 Foo f;
2172 void test() { 2172 void test() {
2173 f<String>("hello"); 2173 f<String>("hello");
2174 } 2174 }
2175 } 2175 }
2176 '''); 2176 ''');
2177 await computeAnalysisResult(source); 2177 await computeAnalysisResult(source);
2178 assertNoErrors(source); 2178 assertNoErrors(source);
2179 verify([source]); 2179 verify([source]);
2180 } 2180 }
2181 2181
2182 test_genericTypeAlias_fieldAndReturnType_typeParameters_arguments() async {
2183 Source source = addSource(r'''
2184 typedef Foo<S> = S Function<T>(T x);
2185 int foo<T>(T x) => 3;
2186 Foo<int> bar() => foo;
2187 void test1() {
2188 bar()<String>("hello");
2189 }
2190
2191 class A {
2192 Foo<int> f;
2193 void test() {
2194 f<String>("hello");
2195 }
2196 }
2197 ''');
2198 await computeAnalysisResult(source);
2199 assertNoErrors(source);
2200 verify([source]);
2201 }
2202
2203 test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments() async {
2204 Source source = addSource(r'''
2205 typedef Foo<S> = S Function<T>(T x);
2206 int foo<T>(T x) => 3;
2207 Foo bar() => foo;
2208 void test1() {
2209 bar()<String>("hello");
2210 }
2211
2212 class A {
2213 Foo f;
2214 void test() {
2215 f<String>("hello");
2216 }
2217 }
2218 ''');
2219 await computeAnalysisResult(source);
2220 assertNoErrors(source);
2221 verify([source]);
2222 }
2223
2182 test_genericTypeAlias_noTypeParameters() async { 2224 test_genericTypeAlias_noTypeParameters() async {
2183 Source source = addSource(r''' 2225 Source source = addSource(r'''
2184 typedef Foo = int Function<T>(T x); 2226 typedef Foo = int Function<T>(T x);
2185 int foo<T>(T x) => 3; 2227 int foo<T>(T x) => 3;
2186 void test1() { 2228 void test1() {
2187 Foo y = foo; 2229 Foo y = foo;
2188 // These two should be equivalent 2230 // These two should be equivalent
2189 foo<String>("hello"); 2231 foo<String>("hello");
2190 y<String>("hello"); 2232 y<String>("hello");
2191 } 2233 }
(...skipping 4108 matching lines...) Expand 10 before | Expand all | Expand 10 after
6300 await computeAnalysisResult(source); 6342 await computeAnalysisResult(source);
6301 assertNoErrors(source); 6343 assertNoErrors(source);
6302 verify([source]); 6344 verify([source]);
6303 reset(); 6345 reset();
6304 } 6346 }
6305 6347
6306 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { 6348 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async {
6307 await _check_wrongNumberOfParametersForOperator(name, "a"); 6349 await _check_wrongNumberOfParametersForOperator(name, "a");
6308 } 6350 }
6309 } 6351 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_driver_test.dart ('k') | pkg/analyzer/test/src/summary/element_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698