Files
wren/test/language/inheritance/is.wren
T

23 lines
494 B
Plaintext
Raw Normal View History

2015-09-01 08:16:04 -07:00
class A {
construct new() {}
}
class B is A {
construct new() {}
}
class C is B {
construct new() {}
}
2015-07-10 09:18:22 -07:00
var a = A.new()
var b = B.new()
var c = C.new()
2013-12-10 16:13:25 -08:00
2015-09-15 07:46:09 -07:00
System.print(a is A) // expect: true
System.print(a is B) // expect: false
System.print(a is C) // expect: false
System.print(b is A) // expect: true
System.print(b is B) // expect: true
System.print(b is C) // expect: false
System.print(c is A) // expect: true
System.print(c is B) // expect: true
System.print(c is C) // expect: true