mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
17 lines
230 B
Perl
17 lines
230 B
Perl
|
|
struct A { a : int }
|
|
A.methods.foo = terra(self : A, a : int)
|
|
return self.a + a
|
|
end
|
|
|
|
terra A:foo()
|
|
return self.a
|
|
end
|
|
|
|
|
|
terra doit()
|
|
var a = A { 3 }
|
|
return a:foo() + a:foo(1)
|
|
end
|
|
local test = require("test")
|
|
test.eq(doit(),7) |