0c8109c964
Closes #43354. Bug: https://github.com/dart-lang/sdk/issues/43354 Change-Id: Idc8f4757a5589638eb4e3ce08cda2c5afa8d5202 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165604 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
32 lines
620 B
Dart
32 lines
620 B
Dart
// Copyright (c) 2020, 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.
|
|
|
|
// The error should be reported on the field, not the constructor.
|
|
|
|
class A {
|
|
late final int foo = 42;
|
|
const A();
|
|
}
|
|
|
|
class B {
|
|
late final int foo = 42;
|
|
late final String bar = "foobar";
|
|
const B();
|
|
}
|
|
|
|
class C {
|
|
late final int foo = 42;
|
|
const C();
|
|
const C.another();
|
|
}
|
|
|
|
class D {
|
|
late final int foo = 42;
|
|
late final String bar = "foobar";
|
|
const D();
|
|
const D.another();
|
|
}
|
|
|
|
main() {}
|