Files
sdk/pkg/front_end/testcases/nnbd/issue43354.dart
T
Dmitry Stefantsov 0c8109c964 [cfe] Adjust error location for const constructors with late fields
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>
2020-10-02 08:30:16 +00:00

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() {}