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

Unified Diff: tests/compiler/dart2js/semantic_visitor_test_send_data.dart

Issue 1182563003: Handle most qualified sends. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Handle qualified access of ambiguous static members. Created 5 years, 6 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 | « tests/compiler/dart2js/semantic_visitor_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/semantic_visitor_test_send_data.dart
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
index 1026dbbd487af83a6c38a14dc139f1eef144ee5b..ebad7892b46f2814d3035d043e93c5f93366b0f8 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -109,6 +109,30 @@ const Map<String, List<Test>> SEND_TESTS = const {
element: 'field(C#o)')),
const Test(
'''
+ class C {
+ var o;
+ }
+ m() => C.o;
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_GET,
+ name: 'o')),
+ const Test(
+ '''
+ class C {
+ C.o();
+ }
+ m() => C.o;
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_GET,
+ name: 'o')),
+ const Test(
+ '''
+ class C {}
+ m() => C.this;
+ ''',
+ null),
+ const Test(
+ '''
class C { static var o; }
m() { C.o = 42; }
''',
@@ -183,6 +207,13 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
element: 'field(C#o)',
arguments: '(null,42)')),
+ const Test(
+ '''
+ class C {}
+ m() => C.this(null, 42);
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
+ name: 'this', arguments: '(null,42)')),
// TODO(johnniwinther): Expect [VISIT_FINAL_STATIC_FIELD_SET] instead.
const Test(
'''
@@ -338,7 +369,6 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_UNRESOLVED_SET,
name: 'o',
rhs: '42')),
- // TODO(johnniwinther): Expected [VISIT_STATIC_SETTER_GET] instead.
const Test(
'''
class C {
@@ -346,8 +376,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
}
m() => C.o;
''',
- const Visit(VisitKind.VISIT_UNRESOLVED_GET,
- name: 'o')),
+ const Visit(VisitKind.VISIT_STATIC_SETTER_GET,
+ element: 'setter(C#o)')),
const Test.clazz(
'''
class C {
@@ -365,8 +395,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
m() => C.o;
}
''',
- const Visit(VisitKind.VISIT_UNRESOLVED_GET,
- name: 'o')),
+ const Visit(VisitKind.VISIT_STATIC_SETTER_GET,
+ element: 'setter(C#o)')),
const Test.prefix(
'''
class C {
@@ -374,8 +404,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
}
''',
'm() => p.C.o;',
- const Visit(VisitKind.VISIT_UNRESOLVED_GET,
- name: 'o')),
+ const Visit(VisitKind.VISIT_STATIC_SETTER_GET,
+ element: 'setter(C#o)')),
const Test(
'''
class C { static set o(_) {} }
@@ -452,14 +482,13 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
element: 'getter(C#o)',
arguments: '(null,42)')),
- // TODO(johnniwinther): Expect [VISIT_STATIC_SETTER_INVOKE] instead.
const Test(
'''
class C { static set o(_) {} }
m() => C.o(null, 42);
''',
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'o',
+ const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
+ element: 'setter(C#o)',
arguments: '(null,42)')),
const Test.clazz(
'''
@@ -478,8 +507,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
m() { C.o(null, 42); }
}
''',
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'o',
+ const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
+ element: 'setter(C#o)',
arguments: '(null,42)')),
const Test.prefix(
'''
@@ -488,8 +517,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
}
''',
'm() { p.C.o(null, 42); }',
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'o',
+ const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
+ element: 'setter(C#o)',
arguments: '(null,42)')),
],
'Static functions': const [
@@ -1243,10 +1272,14 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Test(
'''
class C {}
- m() => C;
+ m() => (C).hashCode;
''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
- constant: 'C')),
+ const [
+ const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
+ receiver: '(C)', name: 'hashCode'),
+ const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
+ constant: 'C'),
+ ]),
],
'Typedef type literals': const [
// Typedef type literals
@@ -3419,6 +3452,22 @@ const Map<String, List<Test>> SEND_TESTS = const {
]),
const Test(
'''
+ class C {
+ static var b;
+ }
+ m(a) => C?.b;
+ ''',
+ const [
+ const Visit(
+ VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_GET,
+ receiver: 'C',
+ name: 'b'),
+ const Visit(
+ VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
+ constant: 'C'),
+ ]),
+ const Test(
+ '''
m(a) => a?.b = 42;
''',
const [
« no previous file with comments | « tests/compiler/dart2js/semantic_visitor_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698