When I type check the following with the latest version (098780f) I get an error that doesn't make sense:
local record Container
end
function Container.new(): Container
return setmetatable({} as Container, { __index = Container })
end
function Container:try_resolve<T>(id:string):T
if id == "foo" then
return 5 as T
end
if id == "bar" then
return "asdf" as T
end
end
function Container:resolve<T>(id:string):T
return self:try_resolve(id)
end
local container:Container = Container.new()
local foo:integer = container:resolve('foo')
local bar:string = container:resolve('bar')
print(foo)
print(bar)
It says "In local declaration: bar: got integer, expected string" on line local bar:string = container:resolve('bar'). It seems the type checking for the previous line bled over into the new line somehow
When I type check the following with the latest version (098780f) I get an error that doesn't make sense:
It says "In local declaration: bar: got integer, expected string" on line
local bar:string = container:resolve('bar')
. It seems the type checking for the previous line bled over into the new line somehow