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

Side by Side Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 2802203003: Partial fix for generic function types - non-driver case (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
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_driver_test.dart ('k') | no next file » | 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) 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 {
2162 Source source = addSource(r'''
2163 typedef Foo = int Function<T>(T x);
2164 int foo<T>(T x) => 3;
2165 Foo bar() => foo;
2166 void test1() {
2167 bar()<String>("hello");
2168 }
2169
2170 class A {
2171 Foo f;
2172 void test() {
2173 f<String>("hello");
2174 }
2175 }
2176 ''');
2177 await computeAnalysisResult(source);
2178 assertNoErrors(source);
2179 verify([source]);
2180 }
2181
2161 test_genericTypeAlias_noTypeParameters() async { 2182 test_genericTypeAlias_noTypeParameters() async {
2162 Source source = addSource(r''' 2183 Source source = addSource(r'''
2163 typedef Foo = int Function<T>(T x); 2184 typedef Foo = int Function<T>(T x);
2164 int foo<T>(T x) => 3; 2185 int foo<T>(T x) => 3;
2165 void test1() { 2186 void test1() {
2166 Foo y = foo; 2187 Foo y = foo;
2167 // These two should be equivalent 2188 // These two should be equivalent
2168 foo<String>("hello"); 2189 foo<String>("hello");
2169 y<String>("hello"); 2190 y<String>("hello");
2170 } 2191 }
(...skipping 4108 matching lines...) Expand 10 before | Expand all | Expand 10 after
6279 await computeAnalysisResult(source); 6300 await computeAnalysisResult(source);
6280 assertNoErrors(source); 6301 assertNoErrors(source);
6281 verify([source]); 6302 verify([source]);
6282 reset(); 6303 reset();
6283 } 6304 }
6284 6305
6285 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { 6306 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async {
6286 await _check_wrongNumberOfParametersForOperator(name, "a"); 6307 await _check_wrongNumberOfParametersForOperator(name, "a");
6287 } 6308 }
6288 } 6309 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698