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

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

Issue 1579303002: fix generic function expressions, part of #25175 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/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.resolver_test; 5 library analyzer.test.generated.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 13025 matching lines...) Expand 10 before | Expand all | Expand 10 after
13036 /*=T*/ f/*<T>*/(/*=T*/ e) => null; 13036 /*=T*/ f/*<T>*/(/*=T*/ e) => null;
13037 static /*=T*/ g/*<T>*/(/*=T*/ e) => null; 13037 static /*=T*/ g/*<T>*/(/*=T*/ e) => null;
13038 static final h = g; 13038 static final h = g;
13039 } 13039 }
13040 13040
13041 /*=T*/ topF/*<T>*/(/*=T*/ e) => null; 13041 /*=T*/ topF/*<T>*/(/*=T*/ e) => null;
13042 var topG = topF; 13042 var topG = topF;
13043 void test/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) { 13043 void test/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) {
13044 var c = new C<int>(); 13044 var c = new C<int>();
13045 /*=T*/ lf/*<T>*/(/*=T*/ e) => null; 13045 /*=T*/ lf/*<T>*/(/*=T*/ e) => null;
13046
13047 var lambdaCall = (/*<E>*/(/*=E*/ e) => e)/*<int>*/(3);
Leaf 2016/01/12 23:56:02 Can you go ahead and add this case to fail_generic
Jennifer Messerly 2016/01/13 00:03:18 good catch, done!
13046 var methodCall = (c.f)/*<int>*/(3); 13048 var methodCall = (c.f)/*<int>*/(3);
13047 var staticCall = (C.g)/*<int>*/(3); 13049 var staticCall = (C.g)/*<int>*/(3);
13048 var staticFieldCall = (C.h)/*<int>*/(3); 13050 var staticFieldCall = (C.h)/*<int>*/(3);
13049 var topFunCall = (topF)/*<int>*/(3); 13051 var topFunCall = (topF)/*<int>*/(3);
13050 var topFieldCall = (topG)/*<int>*/(3); 13052 var topFieldCall = (topG)/*<int>*/(3);
13051 var localCall = (lf)/*<int>*/(3); 13053 var localCall = (lf)/*<int>*/(3);
13052 var paramCall = (pf)/*<int>*/(3); 13054 var paramCall = (pf)/*<int>*/(3);
13053 } 13055 }
13054 '''); 13056 ''');
13055 expect(_findIdentifier('methodCall').staticType.toString(), "int"); 13057 expect(_findIdentifier('methodCall').staticType.toString(), "int");
13056 expect(_findIdentifier('staticCall').staticType.toString(), "int"); 13058 expect(_findIdentifier('staticCall').staticType.toString(), "int");
13057 expect(_findIdentifier('staticFieldCall').staticType.toString(), "int"); 13059 expect(_findIdentifier('staticFieldCall').staticType.toString(), "int");
13058 expect(_findIdentifier('topFunCall').staticType.toString(), "int"); 13060 expect(_findIdentifier('topFunCall').staticType.toString(), "int");
13059 expect(_findIdentifier('topFieldCall').staticType.toString(), "int"); 13061 expect(_findIdentifier('topFieldCall').staticType.toString(), "int");
13060 expect(_findIdentifier('localCall').staticType.toString(), "int"); 13062 expect(_findIdentifier('localCall').staticType.toString(), "int");
13061 expect(_findIdentifier('paramCall').staticType.toString(), "int"); 13063 expect(_findIdentifier('paramCall').staticType.toString(), "int");
13064 expect(_findIdentifier('lambdaCall').staticType.toString(), "int");
13062 } 13065 }
13063 13066
13064 void fail_genericMethod_functionExpressionInvocation_inferred() { 13067 void fail_genericMethod_functionExpressionInvocation_inferred() {
13065 _resolveTestUnit(r''' 13068 _resolveTestUnit(r'''
13066 class C<E> { 13069 class C<E> {
13067 /*=T*/ f/*<T>*/(/*=T*/ e) => null; 13070 /*=T*/ f/*<T>*/(/*=T*/ e) => null;
13068 static /*=T*/ g/*<T>*/(/*=T*/ e) => null; 13071 static /*=T*/ g/*<T>*/(/*=T*/ e) => null;
13069 static final h = g; 13072 static final h = g;
13070 } 13073 }
13071 13074
(...skipping 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after
16680 16683
16681 void _resolveTestUnit(String code) { 16684 void _resolveTestUnit(String code) {
16682 testCode = code; 16685 testCode = code;
16683 testSource = addSource(testCode); 16686 testSource = addSource(testCode);
16684 LibraryElement library = resolve2(testSource); 16687 LibraryElement library = resolve2(testSource);
16685 assertNoErrors(testSource); 16688 assertNoErrors(testSource);
16686 verify([testSource]); 16689 verify([testSource]);
16687 testUnit = resolveCompilationUnit(testSource, library); 16690 testUnit = resolveCompilationUnit(testSource, library);
16688 } 16691 }
16689 } 16692 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698