3f158dcd71
This update computation of implicit field types to return the inferred initializer. The ensure that we only compute the initializer once, and allows us to merge two pipelines for compute the field type and initializer. Change-Id: I6005e19cc3dec9c717e426f06d817e2d45edcff1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451480 Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Reviewed-by: Alexander Thomas <athom@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
26 lines
787 B
Dart
26 lines
787 B
Dart
// Copyright (c) 2018, 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.
|
|
|
|
class A {
|
|
// ^
|
|
// [cfe] The non-abstract class 'A' is missing implementations for these members:
|
|
B();
|
|
// [error column 3, length 4]
|
|
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
|
|
static const field = const B();
|
|
// ^^^^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
|
|
// [cfe] Can't access 'this' in a field initializer to read 'B'.
|
|
}
|
|
|
|
class B {
|
|
const B();
|
|
}
|
|
|
|
main() {
|
|
print(A.field);
|
|
}
|