@@ -446,7 +446,25 @@ class AstExprFunction : public AstExpr
446446 AstStatBlock* body,
447447 size_t functionDepth,
448448 const AstName& debugname,
449- const std::optional<AstTypeList>& returnAnnotation = {},
449+ AstTypePack* returnAnnotation,
450+ AstTypePack* varargAnnotation = nullptr ,
451+ const std::optional<Location>& argLocation = std::nullopt
452+ );
453+
454+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
455+ AstExprFunction (
456+ const Location& location,
457+ const AstArray<AstAttr*>& attributes,
458+ const AstArray<AstGenericType*>& generics,
459+ const AstArray<AstGenericTypePack*>& genericPacks,
460+ AstLocal* self,
461+ const AstArray<AstLocal*>& args,
462+ bool vararg,
463+ const Location& varargLocation,
464+ AstStatBlock* body,
465+ size_t functionDepth,
466+ const AstName& debugname,
467+ const std::optional<AstTypeList>& returnAnnotation,
450468 AstTypePack* varargAnnotation = nullptr ,
451469 const std::optional<Location>& argLocation = std::nullopt
452470 );
@@ -461,7 +479,9 @@ class AstExprFunction : public AstExpr
461479 AstArray<AstGenericTypePack*> genericPacks;
462480 AstLocal* self;
463481 AstArray<AstLocal*> args;
464- std::optional<AstTypeList> returnAnnotation;
482+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
483+ std::optional<AstTypeList> returnAnnotation_DEPRECATED;
484+ AstTypePack* returnAnnotation = nullptr ;
465485 bool vararg = false ;
466486 Location varargLocation;
467487 AstTypePack* varargAnnotation;
@@ -929,6 +949,36 @@ class AstStatDeclareFunction : public AstStat
929949public:
930950 LUAU_RTTI (AstStatDeclareFunction)
931951
952+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
953+ AstStatDeclareFunction (
954+ const Location& location,
955+ const AstName& name,
956+ const Location& nameLocation,
957+ const AstArray<AstGenericType*>& generics,
958+ const AstArray<AstGenericTypePack*>& genericPacks,
959+ const AstTypeList& params,
960+ const AstArray<AstArgumentName>& paramNames,
961+ bool vararg,
962+ const Location& varargLocation,
963+ AstTypePack* retTypes
964+ );
965+
966+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
967+ AstStatDeclareFunction (
968+ const Location& location,
969+ const AstArray<AstAttr*>& attributes,
970+ const AstName& name,
971+ const Location& nameLocation,
972+ const AstArray<AstGenericType*>& generics,
973+ const AstArray<AstGenericTypePack*>& genericPacks,
974+ const AstTypeList& params,
975+ const AstArray<AstArgumentName>& paramNames,
976+ bool vararg,
977+ const Location& varargLocation,
978+ AstTypePack* retTypes
979+ );
980+
981+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
932982 AstStatDeclareFunction (
933983 const Location& location,
934984 const AstName& name,
@@ -942,6 +992,7 @@ class AstStatDeclareFunction : public AstStat
942992 const AstTypeList& retTypes
943993 );
944994
995+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
945996 AstStatDeclareFunction (
946997 const Location& location,
947998 const AstArray<AstAttr*>& attributes,
@@ -971,10 +1022,12 @@ class AstStatDeclareFunction : public AstStat
9711022 AstArray<AstArgumentName> paramNames;
9721023 bool vararg = false ;
9731024 Location varargLocation;
974- AstTypeList retTypes;
1025+ AstTypePack* retTypes;
1026+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1027+ AstTypeList retTypes_DEPRECATED;
9751028};
9761029
977- struct AstDeclaredClassProp
1030+ struct AstDeclaredExternTypeProperty
9781031{
9791032 AstName name;
9801033 Location nameLocation;
@@ -1000,16 +1053,16 @@ struct AstTableIndexer
10001053 std::optional<Location> accessLocation;
10011054};
10021055
1003- class AstStatDeclareClass : public AstStat
1056+ class AstStatDeclareExternType : public AstStat
10041057{
10051058public:
1006- LUAU_RTTI (AstStatDeclareClass )
1059+ LUAU_RTTI (AstStatDeclareExternType )
10071060
1008- AstStatDeclareClass (
1061+ AstStatDeclareExternType (
10091062 const Location& location,
10101063 const AstName& name,
10111064 std::optional<AstName> superName,
1012- const AstArray<AstDeclaredClassProp >& props,
1065+ const AstArray<AstDeclaredExternTypeProperty >& props,
10131066 AstTableIndexer* indexer = nullptr
10141067 );
10151068
@@ -1018,7 +1071,7 @@ class AstStatDeclareClass : public AstStat
10181071 AstName name;
10191072 std::optional<AstName> superName;
10201073
1021- AstArray<AstDeclaredClassProp > props;
1074+ AstArray<AstDeclaredExternTypeProperty > props;
10221075 AstTableIndexer* indexer;
10231076};
10241077
@@ -1095,6 +1148,26 @@ class AstTypeFunction : public AstType
10951148public:
10961149 LUAU_RTTI (AstTypeFunction)
10971150
1151+ AstTypeFunction (
1152+ const Location& location,
1153+ const AstArray<AstGenericType*>& generics,
1154+ const AstArray<AstGenericTypePack*>& genericPacks,
1155+ const AstTypeList& argTypes,
1156+ const AstArray<std::optional<AstArgumentName>>& argNames,
1157+ AstTypePack* returnTypes
1158+ );
1159+
1160+ AstTypeFunction (
1161+ const Location& location,
1162+ const AstArray<AstAttr*>& attributes,
1163+ const AstArray<AstGenericType*>& generics,
1164+ const AstArray<AstGenericTypePack*>& genericPacks,
1165+ const AstTypeList& argTypes,
1166+ const AstArray<std::optional<AstArgumentName>>& argNames,
1167+ AstTypePack* returnTypes
1168+ );
1169+
1170+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
10981171 AstTypeFunction (
10991172 const Location& location,
11001173 const AstArray<AstGenericType*>& generics,
@@ -1104,6 +1177,7 @@ class AstTypeFunction : public AstType
11041177 const AstTypeList& returnTypes
11051178 );
11061179
1180+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
11071181 AstTypeFunction (
11081182 const Location& location,
11091183 const AstArray<AstAttr*>& attributes,
@@ -1124,7 +1198,9 @@ class AstTypeFunction : public AstType
11241198 AstArray<AstGenericTypePack*> genericPacks;
11251199 AstTypeList argTypes;
11261200 AstArray<std::optional<AstArgumentName>> argNames;
1127- AstTypeList returnTypes;
1201+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1202+ AstTypeList returnTypes_DEPRECATED;
1203+ AstTypePack* returnTypes;
11281204};
11291205
11301206class AstTypeTypeof : public AstType
@@ -1483,7 +1559,7 @@ class AstVisitor
14831559 {
14841560 return visit (static_cast <AstStat*>(node));
14851561 }
1486- virtual bool visit (class AstStatDeclareClass * node)
1562+ virtual bool visit (class AstStatDeclareExternType * node)
14871563 {
14881564 return visit (static_cast <AstStat*>(node));
14891565 }
0 commit comments