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

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

Issue 1301583002: Refactoring resolution of updates to type literals. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 dcd840ea45a0d1005b530316426c25c5ce0ed932..34d25eae56c88771269f29e4ce1f59b3e7611a44 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -107,6 +107,15 @@ const Map<String, List<Test>> SEND_TESTS = const {
'm() => p.C.o;',
const Visit(VisitKind.VISIT_STATIC_FIELD_GET,
element: 'field(C#o)')),
+ const Test.clazz(
+ '''
+ class C {
+ var o;
+ static m() => o;
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_GET,
+ error: MessageKind.NO_INSTANCE_AVAILABLE)),
const Test.prefix(
'''
class C {
@@ -189,7 +198,9 @@ const Map<String, List<Test>> SEND_TESTS = const {
null),
const Test(
'''
- class C { static var o; }
+ class C {
+ static var o;
+ }
m() { C.o = 42; }
''',
const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
@@ -225,9 +236,21 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
element: 'field(C#o)',
rhs: '42')),
+ const Test.clazz(
+ '''
+ class C {
+ var o;
+ static m() { o = 42; }
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_SET,
+ error: MessageKind.NO_INSTANCE_AVAILABLE,
+ rhs: '42')),
const Test(
'''
- class C { static var o; }
+ class C {
+ static var o;
+ }
m() { C.o(null, 42); }
''',
const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
@@ -253,6 +276,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
element: 'field(C#o)',
arguments: '(null,42)')),
+ const Test.clazz(
+ '''
+ class C {
+ var o;
+ static m() { o(null, 42); }
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_INVOKE,
+ error: MessageKind.NO_INSTANCE_AVAILABLE,
+ arguments: '(null,42)')),
const Test.prefix(
'''
class C {
@@ -269,7 +302,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
m() => C.this(null, 42);
''',
const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.THIS_PROPERTY, arguments: '(null,42)')),
+ error: MessageKind.THIS_PROPERTY,
+ arguments: '(null,42)')),
// TODO(johnniwinther): Expect [VISIT_FINAL_STATIC_FIELD_SET] instead.
const Test(
'''
@@ -1509,7 +1543,51 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
element: 'type_variable(C#T)',
operator: '--')),
-
+ const Test.clazz(
+ '''
+ class C<T> {
+ static m() => T;
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_GET,
+ error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER)),
+ const Test.clazz(
+ '''
+ class C<T> {
+ static m() => T(null, 42);
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_INVOKE,
+ error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+ arguments: '(null,42)')),
+ const Test.clazz(
+ '''
+ class C<T> {
+ static m() => T += 42;
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_COMPOUND,
+ error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+ operator: '+=',
+ rhs: '42')),
+ const Test.clazz(
+ '''
+ class C<T> {
+ static m() => ++T;
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_PREFIX,
+ error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+ operator: '++')),
+ const Test.clazz(
+ '''
+ class C<T> {
+ static m() => T--;
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_POSTFIX,
+ error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+ operator: '--')),
],
'Dynamic type literals': const [
// Dynamic type literals
@@ -2234,6 +2312,17 @@ const Map<String, List<Test>> SEND_TESTS = const {
''',
const Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
element: 'field(C#a)', operator: '+=', rhs: '42')),
+ const Test.clazz(
+ '''
+ class C {
+ var o;
+ static m() { o += 42; }
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_COMPOUND,
+ error: MessageKind.NO_INSTANCE_AVAILABLE,
+ operator: '+=',
+ rhs: '42')),
const Test(
'''
class C {
@@ -2749,6 +2838,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
''',
const Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
element: 'field(C#a)', operator: '--')),
+ const Test.clazz(
+ '''
+ class C {
+ var o;
+ static m() { ++o; }
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_PREFIX,
+ error: MessageKind.NO_INSTANCE_AVAILABLE,
+ operator: '++')),
const Test(
'''
class C {
@@ -3130,6 +3229,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
''',
const Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
element: 'field(C#a)', operator: '--')),
+ const Test.clazz(
+ '''
+ class C {
+ var o;
+ static m() { o--; }
+ }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_POSTFIX,
+ error: MessageKind.NO_INSTANCE_AVAILABLE,
+ operator: '--')),
const Test(
'''
class C {
« 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