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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 1568643002: clean up generic methods in resolution (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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index b896776ccd5023768d25895f15fedc8de9020386..e468b02f8db0eb9d6bfd80c47c4d21b4b8242deb 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -102,11 +102,9 @@ void main() {
B f = new B();
int x;
double y;
- // The analyzer has what I believe is a bug (dartbug.com/23252) which
- // causes the return type of calls to f to be treated as dynamic.
- x = /*info:DYNAMIC_CAST should be pass*/f(3);
+ x = f(3);
x = /*severe:STATIC_TYPE_ERROR*/f.col(3.0);
- y = /*info:DYNAMIC_CAST should be severe:STATIC_TYPE_ERROR*/f(3);
+ y = /*severe:STATIC_TYPE_ERROR*/f(3);
y = f.col(3.0);
f(/*severe:STATIC_TYPE_ERROR*/3.0);
f.col(/*severe:STATIC_TYPE_ERROR*/3);
@@ -1394,6 +1392,31 @@ void main() {
'''
});
+
+ testChecker('generic methods on different element kinds', {
+ '/main.dart': '''
+class C<E> {
+ /*=T*/ f/*<T>*/(/*=T*/ e) => null;
+ static /*=T*/ g/*<T>*/(/*=T*/ e) => null;
+ static final h = g;
+}
+
+/*=T*/ topF/*<T>*/(/*=T*/ e) => null;
+
+var topG = C.g;
+
+void test/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) {
+ var c = new C<int>();
+ var methodCall = c.f/*<int>*/(3);
+ var localG = C.g;
+ int staticFieldCall = C.h/*<int>*/(3);
+ int topFieldCall = topG/*<int>*/(3);
+ int localVarCall = localG/*<int>*/(3);
+ int paramCall = pf/*<int>*/(3);
+}
+ '''
+ });
+
testChecker('unary operators', {
'/main.dart': '''
class A {

Powered by Google App Engine
This is Rietveld 408576698