blob: 552d93effc3ab032b0fefc2a351a0bbebed9f95c [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 Effectively, each super parameters, super.p:
///
/// Introduces a final variable p with the parameter’s name, just like this.p
/// does, only in scope in the initializer list.
///
/// @description Check that the super parameter introduces a final variable with
/// the parameter's name
/// @author sgrekhov@unipro.ru
// SharedOptions=--enable-experiment=super-parameters
class S {
int s;
S(int x) : s = ++x;
}
class C extends S {
int c;
C(super.x, int x) : c = x;
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
main() {
print(C);
}