@@ -446,7 +446,25 @@ class AstExprFunction : public AstExpr
446
446
AstStatBlock* body,
447
447
size_t functionDepth,
448
448
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,
450
468
AstTypePack* varargAnnotation = nullptr ,
451
469
const std::optional<Location>& argLocation = std::nullopt
452
470
);
@@ -461,7 +479,9 @@ class AstExprFunction : public AstExpr
461
479
AstArray<AstGenericTypePack*> genericPacks;
462
480
AstLocal* self;
463
481
AstArray<AstLocal*> args;
464
- std::optional<AstTypeList> returnAnnotation;
482
+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
483
+ std::optional<AstTypeList> returnAnnotation_DEPRECATED;
484
+ AstTypePack* returnAnnotation = nullptr ;
465
485
bool vararg = false ;
466
486
Location varargLocation;
467
487
AstTypePack* varargAnnotation;
@@ -929,6 +949,36 @@ class AstStatDeclareFunction : public AstStat
929
949
public:
930
950
LUAU_RTTI (AstStatDeclareFunction)
931
951
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
932
982
AstStatDeclareFunction (
933
983
const Location& location,
934
984
const AstName& name,
@@ -942,6 +992,7 @@ class AstStatDeclareFunction : public AstStat
942
992
const AstTypeList& retTypes
943
993
);
944
994
995
+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
945
996
AstStatDeclareFunction (
946
997
const Location& location,
947
998
const AstArray<AstAttr*>& attributes,
@@ -971,10 +1022,12 @@ class AstStatDeclareFunction : public AstStat
971
1022
AstArray<AstArgumentName> paramNames;
972
1023
bool vararg = false ;
973
1024
Location varargLocation;
974
- AstTypeList retTypes;
1025
+ AstTypePack* retTypes;
1026
+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1027
+ AstTypeList retTypes_DEPRECATED;
975
1028
};
976
1029
977
- struct AstDeclaredClassProp
1030
+ struct AstDeclaredExternTypeProperty
978
1031
{
979
1032
AstName name;
980
1033
Location nameLocation;
@@ -1000,16 +1053,16 @@ struct AstTableIndexer
1000
1053
std::optional<Location> accessLocation;
1001
1054
};
1002
1055
1003
- class AstStatDeclareClass : public AstStat
1056
+ class AstStatDeclareExternType : public AstStat
1004
1057
{
1005
1058
public:
1006
- LUAU_RTTI (AstStatDeclareClass )
1059
+ LUAU_RTTI (AstStatDeclareExternType )
1007
1060
1008
- AstStatDeclareClass (
1061
+ AstStatDeclareExternType (
1009
1062
const Location& location,
1010
1063
const AstName& name,
1011
1064
std::optional<AstName> superName,
1012
- const AstArray<AstDeclaredClassProp >& props,
1065
+ const AstArray<AstDeclaredExternTypeProperty >& props,
1013
1066
AstTableIndexer* indexer = nullptr
1014
1067
);
1015
1068
@@ -1018,7 +1071,7 @@ class AstStatDeclareClass : public AstStat
1018
1071
AstName name;
1019
1072
std::optional<AstName> superName;
1020
1073
1021
- AstArray<AstDeclaredClassProp > props;
1074
+ AstArray<AstDeclaredExternTypeProperty > props;
1022
1075
AstTableIndexer* indexer;
1023
1076
};
1024
1077
@@ -1095,6 +1148,26 @@ class AstTypeFunction : public AstType
1095
1148
public:
1096
1149
LUAU_RTTI (AstTypeFunction)
1097
1150
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
1098
1171
AstTypeFunction (
1099
1172
const Location& location,
1100
1173
const AstArray<AstGenericType*>& generics,
@@ -1104,6 +1177,7 @@ class AstTypeFunction : public AstType
1104
1177
const AstTypeList& returnTypes
1105
1178
);
1106
1179
1180
+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1107
1181
AstTypeFunction (
1108
1182
const Location& location,
1109
1183
const AstArray<AstAttr*>& attributes,
@@ -1124,7 +1198,9 @@ class AstTypeFunction : public AstType
1124
1198
AstArray<AstGenericTypePack*> genericPacks;
1125
1199
AstTypeList argTypes;
1126
1200
AstArray<std::optional<AstArgumentName>> argNames;
1127
- AstTypeList returnTypes;
1201
+ // Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1202
+ AstTypeList returnTypes_DEPRECATED;
1203
+ AstTypePack* returnTypes;
1128
1204
};
1129
1205
1130
1206
class AstTypeTypeof : public AstType
@@ -1483,7 +1559,7 @@ class AstVisitor
1483
1559
{
1484
1560
return visit (static_cast <AstStat*>(node));
1485
1561
}
1486
- virtual bool visit (class AstStatDeclareClass * node)
1562
+ virtual bool visit (class AstStatDeclareExternType * node)
1487
1563
{
1488
1564
return visit (static_cast <AstStat*>(node));
1489
1565
}
0 commit comments