From 71b58dc82d69507cf55f3396ea9b207777c85e02 Mon Sep 17 00:00:00 2001 From: ffrostfall <80861876+ffrostfall@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:53:27 -0500 Subject: [PATCH] Update docs/metatable-type-functions.md Co-authored-by: ariel --- docs/metatable-type-functions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/metatable-type-functions.md b/docs/metatable-type-functions.md index b13bba3..abec16f 100644 --- a/docs/metatable-type-functions.md +++ b/docs/metatable-type-functions.md @@ -70,8 +70,9 @@ type metatable = { type MetatableType = getmetatable> ``` -If the type passed into the type function doesn't have a metatable and it *could* have a metatable (so primitives, singletons, classes, and tables), then it will return nil. -If the type passed in is an intersection or union, then it will return an intersection or union respectively. +If the type passed in does not support metatables in the type system (i.e. at the time of writing, is not any of a primitive, a singleton, a class, a table, or a union or intersection thereof), it should error when passed to `getmetatable`. +If the type passed in is an intersection or union of things that support metatables, then it will return an intersection or union of those metatables respectively. +If no metatable is present, but the type system supports metatables for that type, it should return the `nil` type indicating that there is no metatable present. ## Drawbacks