Files
sdk/tests/language/abstract/factory_constructor_test.dart
T
Robert Nystrom 1d684cdfb0 Reformat tests/language/abstract.
Change-Id: I18bbc65a798e79fb5e69a9a4134c10a9f6cdbb3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399860
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-12-11 23:31:53 -08:00

37 lines
851 B
Dart

// Copyright (c) 2012, 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.
// Dart test program for constructors and initializers.
// Exercises issue 2282, factory constructors in abstract classes should
// not emit a static type warning
class B extends A1 {
B() {}
method() {}
}
abstract class A1 {
A1() {}
method(); // Abstract.
factory A1.make() {
return new B();
}
}
class A2 {
// ^
// [cfe] The non-abstract class 'A2' is missing implementations for these members:
// Intentionally abstract method.
method();
// [error column 3, length 9]
// [analyzer] COMPILE_TIME_ERROR.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
A2.make() {}
}
main() {
new A1.make();
new A2.make();
}