blob: 62347b09e7fadc64afbd8f2f84261ca47bdf4b17 [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 Test equality of function and methods tearoffs.
/// https://github.com/dart-lang/language/issues/1712
///
/// @description Checks equality of generic mixin methods tearoffs
/// @author sgrekhov@unipro.ru
// SharedOptions=--enable-experiment=constructor-tearoffs
import "../../Utils/expect.dart";
class A {
T mixedInSuperMethod<T extends num>(T t) => t;
}
mixin M on A {
void mixedInMethod<T>() {}
T mixedInSuperMethod<T extends num>(T t) => super.mixedInSuperMethod<T>(t) + 1 as T;
}
main() {
A a = new A();
var s1 = a.mixedInSuperMethod<int>;
int Function(int) s2 = a.mixedInSuperMethod;
Expect.equals(s1, s2);
Expect.equals(s1, a.mixedInSuperMethod<int>);
Expect.notEquals(s1, a.mixedInSuperMethod<num>);
}