mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-21 08:45:32 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
17
samples/Terra/overload.t
Normal file
17
samples/Terra/overload.t
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
terra foo(a : int)
|
||||
return 1
|
||||
end
|
||||
|
||||
terra foo(a : &int8)
|
||||
return 2
|
||||
end
|
||||
|
||||
print(#foo.definitions)
|
||||
|
||||
terra doit()
|
||||
return foo(1) + foo("what")
|
||||
end
|
||||
|
||||
local test = require("test")
|
||||
test.eq(doit(),3)
|
||||
Reference in New Issue
Block a user