blob: 27766fda16e67fecd158ed26664f5ad5a322e39b [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.
/// @description Checks equality of non-generic static methods tearoffs
/// @author
// SharedOptions=--enable-experiment=constructor-tearoffs
import "../../Utils/expect.dart";
class C {
static void foo1() {}
static void foo2() {}
main() {
const c1 = C.foo1;
const c2 = C.foo1;
const c3 = C.foo2;
var v1 = C.foo1;
var v2 = C.foo1;
var v3 = C.foo2;
const CheckIdentical(c1, c2);
Expect.notEquals(c3, c1);
Expect.equals(c1, v1);
Expect.identical(v1, v2);
Expect.identical(c3, v3);
Expect.notEquals(v1, v3);