mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
16 lines
207 B
Perl
16 lines
207 B
Perl
local function foo(T)
|
|
terra T:what()
|
|
return self.a + self.b
|
|
end
|
|
end
|
|
struct A(foo) {
|
|
a : int;
|
|
b : int;
|
|
}
|
|
|
|
terra test()
|
|
var a = A {1,2}
|
|
return a:what()
|
|
end
|
|
|
|
assert(test() == 3) |