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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1658723005: Resynthesize static method references. (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
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index 9d90ee7061e184e12ab6e6957a9037ff74935ba6..e5719a7e2664c33c2e2d1b2909efc0680529e3ed 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -236,7 +236,6 @@ class ResynthTest extends ResolverTestCase {
expect(r, isNull, reason: desc);
} else {
expect(r, isNotNull, reason: desc);
- compareTypes(r.staticType, o.staticType, desc);
Paul Berry 2016/02/01 20:48:47 Why is it ok to delete this check?
scheglov 2016/02/01 20:52:45 By the same reason why we did this for SimpleIdent
if (o is ParenthesizedExpression) {
// We don't resynthesize parenthesis, so just ignore it.
compareConstantExpressions(r, o.expression, desc);
@@ -1054,6 +1053,46 @@ const V = p.C.F;
''');
}
+ test_const_reference_staticMethod() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+class C {
+ static int m(int a, String b) => 42;
+}
+const V = C.m;
+''');
+ }
+
+ test_const_reference_staticMethod_imported() {
+ shouldCompareConstValues = true;
+ addLibrarySource(
+ '/a.dart',
+ r'''
+class C {
+ static int m(int a, String b) => 42;
+}
+''');
+ checkLibrary(r'''
+import 'a.dart';
+const V = C.m;
+''');
+ }
+
+ test_const_reference_staticMethod_imported_withPrefix() {
+ shouldCompareConstValues = true;
+ addLibrarySource(
+ '/a.dart',
+ r'''
+class C {
+ static int m(int a, String b) => 42;
+}
+''');
+ checkLibrary(r'''
+import 'a.dart' as p;
+const V = p.C.m;
+''');
+ }
+
test_const_reference_topLevelVariable() {
shouldCompareConstValues = true;
checkLibrary(r'''
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698