dart-sdk/tests/language_2/invalid_assignment_to_postfix_increment_test.dart
Paul Berry 3d27982419 Add a language_2 test for invalid assignment to postfix increment.
Prior to c95ef874aa, case 02 crashed the
front end.  Prior to f074f3c120, case 01
crashed analyzer/FE integration.  Prior to
a94e43af7c, cases 02 and 03 crashed
analyzer/FE integration.  So it seems worth adding a test to make sure
we don't regress.

Change-Id: I0e1af7d9ed397d40dd1aebab3ff919999379d824
Reviewed-on: https://dart-review.googlesource.com/71369
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-24 18:29:14 +00:00

14 lines
382 B
Dart

// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
void f(int x, int y) {
x++ = y; //# 01: compile-time error
x++ += y; //# 02: compile-time error
x++ ??= y; //# 03: compile-time error
}
main() {
f(1, 2);
}