mlox/lox.t/operator/equals_method.lox

13 lines
263 B
Lox
Raw Normal View History

2024-08-03 02:44:12 +02:00
// Bound methods have identity equality.
class Foo {
method() {}
}
var foo = Foo();
var fooMethod = foo.method;
// Same bound method.
print fooMethod == fooMethod; // expect: true
// Different closurizations.
print foo.method == foo.method; // expect: false