From 97d436849f48160b829581ee80cc578c4ca79a2d Mon Sep 17 00:00:00 2001 From: ffrostfall <80861876+ffrostfall@users.noreply.github.com> Date: Tue, 4 Feb 2025 00:37:54 -0500 Subject: [PATCH] Fix typeof() usage --- docs/metatable-type-functions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/metatable-type-functions.md b/docs/metatable-type-functions.md index e88e69b..14f7a4b 100644 --- a/docs/metatable-type-functions.md +++ b/docs/metatable-type-functions.md @@ -19,7 +19,7 @@ could be reduced to: ```luau local clock = {} -type Identity = setmetatable<{ time: number }, { __index: clock }> +type Identity = setmetatable<{ time: number }, { __index: typeof(clock) }> ``` ### `getmetatable` Type Function @@ -30,27 +30,27 @@ type Identity = setmetatable<{ time: number }, { __index: clock }> ### `setmetatable` Type Function -In the following code example, `Identity` should evaluate to `{ sound: string, @metatable: { __index: animal } }`: +In the following code example, `Identity` should evaluate to `{ sound: string, @metatable: { __index: typeof(animal) } }`: ```luau local animal = {} type Identity = setmetatable<{ sound: string }, { - __index: animal + __index: typeof(animal) }> ``` ### `getmetatable` Type Function -In the following code example, `ReversedIdentity` should evaluate to `{ __index: animal }`: +In the following code example, `ReversedIdentity` should evaluate to `{ __index: typeof(animal) }`: ```luau local animal = {} type Identity = setmetatable<{ sound: string }, { - __index: animal + __index: typeof(animal) }> type ReversedIdentity = getmetatable