| Index: tests/language/const_getter_test.dart
|
| diff --git a/tests/language/regress_21998_1_test.dart b/tests/language/const_getter_test.dart
|
| similarity index 56%
|
| copy from tests/language/regress_21998_1_test.dart
|
| copy to tests/language/const_getter_test.dart
|
| index 3237f3396629f6fd11270e1adc290bec78713958..97717e89fae6f37d07666e6551804b3d63b998df 100644
|
| --- a/tests/language/regress_21998_1_test.dart
|
| +++ b/tests/language/const_getter_test.dart
|
| @@ -2,17 +2,21 @@
|
| // 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.
|
|
|
| -import 'dart:math' as Math;
|
| +// Check that const getters are not allowed.
|
| +
|
| import 'package:expect/expect.dart';
|
|
|
| -main() {
|
| - Expect.equals(4, new C().m());
|
| +class C {
|
| + const C();
|
| +
|
| + const /// 01: compile-time error
|
| + get x => 1;
|
| }
|
|
|
| -class C {
|
| - max(a) => a;
|
| +const /// 02: compile-time error
|
| +get y => 2;
|
|
|
| - m() {
|
| - return max(Math.max(2, 4));
|
| - }
|
| -}
|
| +main() {
|
| + Expect.equals(1, const C().x);
|
| + Expect.equals(2, y);
|
| +}
|
|
|