Typed Lua · 31 / 69
Keep array elements consistent
YOUR TASK
Make this happen
An array annotation applies to every element. Replace the incompatible string with the required number.
Read the cases in
lesson.test.lua, then choose Check solution to see what needs to change.Update
subject.luauntil every test passes. Keep the supplied tests unchanged.
Read the starter and tests
subject.lua
exports.values = function(): { number }
return { 1, "two", 3 }
end
lesson.test.lua
local t = require("test")
local subject = require("cococo.subject")
t.it("numeric sequence", function()
local s = subject.load()
t.expect(s.values()):deep_eq({ 1, 2, 3 })
end)