@@ -0,0 +1 @@
|
||||
Object.new() // expect runtime error: Object metaclass does not implement 'new()'.
|
||||
@@ -1,2 +1,4 @@
|
||||
class Foo {}
|
||||
class Foo {
|
||||
construct new() {}
|
||||
}
|
||||
IO.print(!Foo.new()) // expect: false
|
||||
|
||||
@@ -24,7 +24,9 @@ IO.print(Object.same(Bool, Num)) // expect: false
|
||||
IO.print(Object.same(Bool, Bool)) // expect: true
|
||||
|
||||
// Other types compare by identity.
|
||||
class Foo {}
|
||||
class Foo {
|
||||
construct new() {}
|
||||
}
|
||||
|
||||
var foo = Foo.new()
|
||||
IO.print(Object.same(foo, foo)) // expect: true
|
||||
@@ -32,6 +34,7 @@ IO.print(Object.same(foo, Foo.new())) // expect: false
|
||||
|
||||
// Ignores == operators.
|
||||
class Bar {
|
||||
construct new() {}
|
||||
==(other) { true }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
class Foo {}
|
||||
class Foo {
|
||||
construct new() {}
|
||||
}
|
||||
IO.print(Foo.new().toString == "instance of Foo") // expect: true
|
||||
|
||||
Reference in New Issue
Block a user