blob: 272d5ef7a715041c96e9d77145daf19c12ff2fe3 [file] [log] [blame]
// Copyright (c) 2021, 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 We also copy the default value of the associated
/// super-constructor if applicable:
/// ...
/// It’s then a compile-time error if p is optional, its type is potentially
/// non-nullable and it still does not have a default value.
///
/// @description Check that it’s then a compile-time error if p is optional, its
/// type is potentially non-nullable and it still does not have a default value.
/// @author sgrekhov@unipro.ru
// SharedOptions=--enable-experiment=super-parameters
abstract class S {
int s1;
S([this.s1]);
// ^^
// [analyzer] unspecified
// [cfe] unspecified
}
class C extends S {
num c1;
C(this.c1, [super.s1, num x = 42]);
// ^^
// [analyzer] unspecified
// [cfe] unspecified
}
main() {
C(42);
}