tomo/test/import.tm
2025-04-04 17:06:09 -04:00

21 lines
474 B
Tcl

vectors := use ../examples/vectors/vectors.tm
use ./use_import.tm
func returns_vec(->vectors.Vec2):
return vectors.Vec2(1, 2)
func returns_imported_type(->ImportedType):
return get_value() # Imported from ./use_import.tm
func main():
>> empty : [vectors.Vec2] = []
>> returns_vec()
= Vec2(x=1, y=2)
>> imported : [ImportedType] = []
>> returns_imported_type()
= ImportedType("Hello")
>> needs_initializing # imported from ./use_import.tm
= 999999999999999999