Update typecheck.md

Tweak Roblox types section a tiny bit
This commit is contained in:
Arseny Kapoulkine 2020-09-30 11:25:18 -07:00 committed by GitHub
parent 8e38c0ec7d
commit 7480d62ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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