blob: ab7fec131a9df6c7960aef7f660e78e7255d42f8 [file]
// 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 A compile-time error occurs if a final static or library variable
/// has no initializing expression, unless the variable declaration has the
/// modifier `late` or the modifier `external`.
///
/// @note There is no this statement in the specification, it is defined by the
/// grammar.
///
/// @description Checks that it is a compile error when a `final` library
/// variable is not initialized in its declaration.
/// @author rodionov
/// @issue #27510
final int v1;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final int? v2;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final v3;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final Null v4;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final void v5;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final Object? v6;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final dynamic v7;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
final Never v8;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
main() {
print(v1);
print(v2);
print(v3);
print(v4);
print(v6);
print(v7);
print(v8);
}