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

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

Issue 2360303003: Issue 27392. Fix for invoking objects with function-bounds type parameter types. (Closed)
Patch Set: Created 4 years, 3 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/lib/src/generated/element_resolver.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 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/error/error.dart'; 9 import 'package:analyzer/error/error.dart';
10 import 'package:analyzer/src/error/codes.dart'; 10 import 'package:analyzer/src/error/codes.dart';
(...skipping 3146 matching lines...) Expand 10 before | Expand all | Expand 10 after
3157 class B extends A { 3157 class B extends A {
3158 g() { 3158 g() {
3159 f(); 3159 f();
3160 } 3160 }
3161 }'''); 3161 }''');
3162 computeLibrarySourceErrors(source); 3162 computeLibrarySourceErrors(source);
3163 assertNoErrors(source); 3163 assertNoErrors(source);
3164 verify([source]); 3164 verify([source]);
3165 } 3165 }
3166 3166
3167 void test_invocationOfNonFunction_functionTypeTypeParameter() {
3168 Source source = addSource(r'''
3169 typedef void Action<T>(T x);
3170 class C<T, U extends Action<T>> {
3171 T value;
3172 U action;
3173 C(this.value, [this.action]);
3174 void act() {
3175 action(value);
3176 }
3177 }
3178 ''');
3179 computeLibrarySourceErrors(source);
3180 assertNoErrors(source);
3181 verify([source]);
3182 }
3183
3167 void test_invocationOfNonFunction_getter() { 3184 void test_invocationOfNonFunction_getter() {
3168 Source source = addSource(r''' 3185 Source source = addSource(r'''
3169 class A { 3186 class A {
3170 var g; 3187 var g;
3171 } 3188 }
3172 f() { 3189 f() {
3173 A a; 3190 A a;
3174 a.g(); 3191 a.g();
3175 }'''); 3192 }''');
3176 computeLibrarySourceErrors(source); 3193 computeLibrarySourceErrors(source);
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
6118 reset(); 6135 reset();
6119 } 6136 }
6120 6137
6121 void _check_wrongNumberOfParametersForOperator1(String name) { 6138 void _check_wrongNumberOfParametersForOperator1(String name) {
6122 _check_wrongNumberOfParametersForOperator(name, "a"); 6139 _check_wrongNumberOfParametersForOperator(name, "a");
6123 } 6140 }
6124 6141
6125 CompilationUnit _getResolvedLibraryUnit(Source source) => 6142 CompilationUnit _getResolvedLibraryUnit(Source source) =>
6126 analysisContext.getResolvedCompilationUnit2(source, source); 6143 analysisContext.getResolvedCompilationUnit2(source, source);
6127 } 6144 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698