blob: 6d4b9b2b638a71a845b9f69361586d0d50d907ae [file] [log] [blame]
// 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.
/**
* @assertion It is an error if a mixin declaration or a class declaration with
* no generative constructors declares an instance variable with a potentially
* non-nullable type and no initializer expression unless the variable is marked
* with the late modifier.
*
* @description Check that it is an error if a class declaration with no
* generative constructors declares an instance variable with a potentially
* non-nullable type and no initializer expression. Test some class A*
* @author sgrekhov@unipro.ru
* @issue 40677
* @issue 40940
*/
// Requirements=nnbd-weak
import "legacy_lib.dart";
class C {
A a;
// ^
// [analyzer] unspecified
// [cfe] unspecified
factory C.f() = D;
}
class D implements C {
A a = new A();
D();
}
main() {
new C.f();
}