mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-04 19:00:54 +01:00
Correct string.find and string.match return types (#554)
This commit is contained in:
parent
ce9f4e23ae
commit
e0ac24d1ed
1 changed files with 4 additions and 2 deletions
|
@ -750,13 +750,15 @@ TypeId SingletonTypes::makeStringMetatable()
|
||||||
TableTypeVar::Props stringLib = {
|
TableTypeVar::Props stringLib = {
|
||||||
{"byte", {arena->addType(FunctionTypeVar{arena->addTypePack({stringType, optionalNumber, optionalNumber}), numberVariadicList})}},
|
{"byte", {arena->addType(FunctionTypeVar{arena->addTypePack({stringType, optionalNumber, optionalNumber}), numberVariadicList})}},
|
||||||
{"char", {arena->addType(FunctionTypeVar{numberVariadicList, arena->addTypePack({stringType})})}},
|
{"char", {arena->addType(FunctionTypeVar{numberVariadicList, arena->addTypePack({stringType})})}},
|
||||||
{"find", {makeFunction(*arena, stringType, {}, {}, {stringType, optionalNumber, optionalBoolean}, {}, {optionalNumber, optionalNumber})}},
|
{"find", {arena->addType(FunctionTypeVar{arena->addTypePack({stringType, stringType, optionalNumber, optionalBoolean}),
|
||||||
|
arena->addTypePack(TypePack{{optionalNumber, optionalNumber}, stringVariadicList})})}},
|
||||||
{"format", {formatFn}}, // FIXME
|
{"format", {formatFn}}, // FIXME
|
||||||
{"gmatch", {gmatchFunc}},
|
{"gmatch", {gmatchFunc}},
|
||||||
{"gsub", {gsubFunc}},
|
{"gsub", {gsubFunc}},
|
||||||
{"len", {makeFunction(*arena, stringType, {}, {}, {}, {}, {numberType})}},
|
{"len", {makeFunction(*arena, stringType, {}, {}, {}, {}, {numberType})}},
|
||||||
{"lower", {stringToStringType}},
|
{"lower", {stringToStringType}},
|
||||||
{"match", {makeFunction(*arena, stringType, {}, {}, {stringType, optionalNumber}, {}, {optionalString})}},
|
{"match", {arena->addType(FunctionTypeVar{arena->addTypePack({stringType, stringType, optionalNumber}),
|
||||||
|
arena->addTypePack(TypePackVar{VariadicTypePack{optionalString}})})}},
|
||||||
{"rep", {makeFunction(*arena, stringType, {}, {}, {numberType}, {}, {stringType})}},
|
{"rep", {makeFunction(*arena, stringType, {}, {}, {numberType}, {}, {stringType})}},
|
||||||
{"reverse", {stringToStringType}},
|
{"reverse", {stringToStringType}},
|
||||||
{"sub", {makeFunction(*arena, stringType, {}, {}, {numberType, optionalNumber}, {}, {stringType})}},
|
{"sub", {makeFunction(*arena, stringType, {}, {}, {numberType, optionalNumber}, {}, {stringType})}},
|
||||||
|
|
Loading…
Add table
Reference in a new issue