mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-12 21:10:37 +00:00
Update typecheck.md
Tweak Roblox types section a tiny bit
This commit is contained in:
parent
8e38c0ec7d
commit
7480d62ba9
1 changed files with 2 additions and 0 deletions
|
@ -309,6 +309,8 @@ local onlyNumber: number = stringOrNumber -- not ok
|
|||
|
||||
Roblox supports a rich set of classes and data types, [documented here](https://developer.roblox.com/en-us/api-reference). All of them are readily available for the type checker to use by their name (e.g. `Part` or `RaycastResult`).
|
||||
|
||||
When one type inherits from another type, the type checker models this relationship and allows to cast a subclass to the parent class implicitly, so you can pass a `Part` to a function that expects an `Instance`.
|
||||
|
||||
Additionally, we can automatically deduce what calls like `Instance.new` and `game:GetService` are supposed to return:
|
||||
|
||||
```lua
|
||||
|
|
Loading…
Reference in a new issue