blob: fc1815579027ac65967be29f16726065c14740a2 [file] [log] [blame]
// Copyright (c) 2011, 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.
/// @assertion It is a compile-time error if a final instance variable whose
/// declaration has an initializer expression is also initialized by a
/// constructor, either by an initializing formal or an initializer list entry.
///
/// @description Checks that a compile error occurs if a final instance variable
/// that has been initialized in declaration is also initialized by a
/// constructor.
/// @author rodionov
/// @issue 12539
class C {
final v = 1;
C() : v = 2 {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
main() {
new C();
}