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

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

Issue 1449343003: Handle prefix as expression in SendSet. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/compiler/lib/src/resolution/members.dart ('k') | tests/language/language_dart2js.status » ('j') | 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 cd03cd875fd0a0071127db16ee88ffac938b182c..a0fd164a36e954bf70e9ef46465e6f5fd2159dbd 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -803,6 +803,13 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
element: 'field(o)',
rhs: '42')),
+ const Test.prefix(
+ '''
+ ''',
+ 'm() { p = 42; }',
+ const Visit(VisitKind.ERROR_INVALID_SET,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ rhs: '42')),
const Test(
'''
final o = 0;
@@ -851,6 +858,13 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
element: 'field(o)',
arguments: '(null,42)')),
+ const Test.prefix(
+ '''
+ ''',
+ 'm() { p(null, 42); }',
+ const Visit(VisitKind.ERROR_INVALID_INVOKE,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ arguments: '(null,42)')),
const Test(
'''
m() => o;
@@ -2414,6 +2428,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
error: MessageKind.NO_INSTANCE_AVAILABLE,
operator: '+=',
rhs: '42')),
+ const Test.prefix(
+ '''
+ ''',
+ '''
+ m() { p += 42; }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_COMPOUND,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ operator: '+=',
+ rhs: '42')),
const Test(
'''
class C {
@@ -2933,6 +2957,15 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.ERROR_INVALID_PREFIX,
error: MessageKind.NO_INSTANCE_AVAILABLE,
operator: '++')),
+ const Test.prefix(
+ '''
+ ''',
+ '''
+ m() { ++p; }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_PREFIX,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ operator: '++')),
const Test(
'''
class C {
@@ -3318,6 +3351,15 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.ERROR_INVALID_POSTFIX,
error: MessageKind.NO_INSTANCE_AVAILABLE,
operator: '--')),
+ const Test.prefix(
+ '''
+ ''',
+ '''
+ m() { p--; }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_POSTFIX,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ operator: '--')),
const Test(
'''
class C {
@@ -4122,6 +4164,15 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
error: MessageKind.NO_INSTANCE_AVAILABLE,
rhs: '42')),
+ const Test.prefix(
+ '''
+ ''',
+ '''
+ m() { p ??= 42; }
+ ''',
+ const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ rhs: '42')),
const Test(
'''
class C {
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698