Closed Veltas closed 8 years ago
Here is a minimal program using a file:
local input = io.open("test") if input then local stuff = input:read("a") print(stuff) input:close() end
This fails to compile on master (strict and non-strict modes):
filetest.tl:6:16: type error, attempt to index 'file' with 'read' filetest.tl:8:2: type error, attempt to index 'file' with 'close'
The file type is defined in e.g. typedlua/lsl53/io.tld:
file
typedlua/lsl53/io.tld
userdata file close : (self) -> (boolean?, string?, number?) flush : (self) -> (boolean) lines : (self, string|number*) -> (() -> (string|number*)) read : (self, string|number*) -> (string|number*) seek : (self, string?, integer?) -> (integer) | (nil, string, integer) setvbuf : (self, string, integer?) -> (boolean) | (nil, string, integer) write : (self, string|number*) -> (self) | (nil, string, integer) end
The compiler error is reported by check_invoke, on tlchecker.lua:1006.
check_invoke
tlchecker.lua:1006
Here is a minimal program using a file:
This fails to compile on master (strict and non-strict modes):
The
file
type is defined in e.g.typedlua/lsl53/io.tld
:The compiler error is reported by
check_invoke
, ontlchecker.lua:1006
.