How can I use the type system?

As of recently you could add type annotations

local x: number = 10

However in what ways can this change the behavior of code? I tried the following but no error is raised

--!strict
local x: number = 10
x = "hello" -- Editor warning
print(x) -- Prints hello

Is there a way to enable type mismatches to raise errors, so that I could remove assert(typeof(x)=="number") and similar?

1 Like

Type hints are for developers. The runtime completely ignores your hints.

You don’t really need to do type checking unless you’re dealing with remotes. In that case, try t.