mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 23:31:42 +00:00
98a253186c
Add regression test. Adjust various status files. Change-Id: I97bdf960260f0a13c2cfc6d95299d67a44c2238d Reviewed-on: https://dart-review.googlesource.com/11247 Reviewed-by: Siva Annamalai <asiva@google.com>
22 lines
605 B
Dart
22 lines
605 B
Dart
// Copyright (c) 2017, 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.
|
|
|
|
// VMOptions=--enable_asserts
|
|
|
|
// Verify that only static members can be accessed in initializers, and this
|
|
// applies to asserts in initializers.
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
class A {
|
|
A.ok() : b = a; //# 01: compile-time error
|
|
A.ko() : assert(a == null); //# 02: compile-time error
|
|
var a, b;
|
|
}
|
|
|
|
main() {
|
|
new A.ok(); //# 01: continued
|
|
new A.ko(); //# 02: continued
|
|
}
|