blob: 10b543f96c9e29b535cee4927c0ed21ebcd42ac4 [file] [log] [blame]
// Copyright (c) 2019, 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 = 2.9
/// @assertion an extension declaration is a top-level declaration with a grammar
/// similar to:
/// <extension> ::=
/// `extension' <identifier>? <typeParameters>? `on' <type> `?'? `{'
/// memberDeclaration*
/// `}'
/// Instance member declaration parameters must not be marked covariant
///
/// @description Check that instance member declaration parameters must not be
/// marked covariant
/// @author sgrekhov@unipro.ru
class A {}
class C extends A {
}
extension on C {
addChild(covariant A child) {} //# 01: compile-time error
addChild2(A c, [covariant A child]) {} //# 02: compile-time error
addChild3(A c, {covariant A child}) {} //# 03: compile-time error
void set setter (covariant A value) {} //# 04: compile-time error
C operator+(covariant A other) => this; //# 05: compile-time error
}
main() {
new C();
}