From b4c1e6ede01b00b2be01943db229f974074e951c Mon Sep 17 00:00:00 2001 From: MagmaBurnsV <111158858+MagmaBurnsV@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:43:30 -0400 Subject: [PATCH] Update EmbeddedBuiltinDefinitions.cpp to use more string literals Changes types for _VERSION, type and select to use more accurate string literals. --- Analysis/src/EmbeddedBuiltinDefinitions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Analysis/src/EmbeddedBuiltinDefinitions.cpp b/Analysis/src/EmbeddedBuiltinDefinitions.cpp index dfc6ff07..1ac883bc 100644 --- a/Analysis/src/EmbeddedBuiltinDefinitions.cpp +++ b/Analysis/src/EmbeddedBuiltinDefinitions.cpp @@ -102,13 +102,13 @@ declare function require(target: any): any declare function getfenv(target: any): { [string]: any } declare _G: any -declare _VERSION: string +declare _VERSION: "Luau" declare function gcinfo(): number declare function print(...: T...) -declare function type(value: T): string +declare function type(value: T): "nil" | "boolean" | "number" | "vector" | "string" | "table" | "function" | "userdata" | "thread" declare function typeof(value: T): string -- `assert` has a magic function attached that will give more detailed type information @@ -135,7 +135,7 @@ declare function pcall(f: (A...) -> R..., ...: A...): (boolean, R... declare function xpcall(f: (A...) -> R1..., err: (E) -> R2..., ...: A...): (boolean, R1...) -- `select` has a magic function attached to provide more detailed type information -declare function select(i: string | number, ...: A...): ...any +declare function select(i: "#" | number, ...: A...): ...any -- FIXME: This type is not entirely correct - `loadstring` returns a function or -- (nil, string).