mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
remove optional second arg
This commit is contained in:
parent
22ead5220a
commit
73f6bd9b6b
1 changed files with 1 additions and 1 deletions
|
@ -347,7 +347,7 @@ And using `assert` will work with the above type guards:
|
||||||
```lua
|
```lua
|
||||||
local stringOrNumber: string | number = "foo"
|
local stringOrNumber: string | number = "foo"
|
||||||
|
|
||||||
assert(type(stringOrNumber) == "string", "stringOrNumber is a string")
|
assert(type(stringOrNumber) == "string")
|
||||||
|
|
||||||
local onlyString: string = stringOrNumber -- ok
|
local onlyString: string = stringOrNumber -- ok
|
||||||
local onlyNumber: number = stringOrNumber -- not ok
|
local onlyNumber: number = stringOrNumber -- not ok
|
||||||
|
|
Loading…
Add table
Reference in a new issue