mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-19 16:54:08 +10:00
23 lines
252 B
Plaintext
23 lines
252 B
Plaintext
//test function chaining with the dot operator
|
|
|
|
fn _identity(self) {
|
|
return self;
|
|
}
|
|
|
|
fn _check(self) {
|
|
assert self == 42, "dot chaining failed";
|
|
return self;
|
|
}
|
|
|
|
var val = 42;
|
|
|
|
val
|
|
.identity()
|
|
.check()
|
|
.identity()
|
|
.check()
|
|
;
|
|
|
|
|
|
print "All good";
|