From 7480d62ba92d8c05158240618528c204f636bacf Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 30 Sep 2020 11:25:18 -0700 Subject: [PATCH] Update typecheck.md Tweak Roblox types section a tiny bit --- docs/typecheck.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/typecheck.md b/docs/typecheck.md index 6720ae2c..da3aeb5d 100644 --- a/docs/typecheck.md +++ b/docs/typecheck.md @@ -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