# Typed Lua inference notes
All code samples assume `--!strict`.
Typed Lua uses HM-typing according to an engineer at Roblox.
Typed Lua does not attempt to infer multiple return types. It infers that the return type is the first return used.
```lua
function foo(x)
if x == 1 then
return "foo"
else
return 2 -- Type mismatch: string and number
end
end
```
Typed Lua, unlike Rust (HM) or TypeScript (not HM), attempts to infer function parameters.
```lua
function foo(x)
return Vector3.new(x, x, x)
end
foo("foo") -- Type mismatch nil | number and string
```