@@ -965,10 +965,17 @@ CapJitAddTypeSignature( "ListWithIdenticalEntries", [ IsInt, IsObject ], functio
965
965
end );
966
966
967
967
CapJitAddTypeSignature( " Concatenation" , [ IsList ] , function ( input_types )
968
+ local filter;
968
969
969
- Assert ( 0 , input_types[ 1 ] .element_type.filter = IsList );
970
+ if input_types[ 1 ] .element_type.filter = IsList then
971
+ filter := IsList;
972
+ elif input_types[ 1 ] .element_type.filter = IsLazyArray then
973
+ filter := IsLazyArray;
974
+ else
975
+ Error( input_types[ 1 ] .element_type.filter, " is not in [ IsList, IsLazyArray ]\n " );
976
+ fi ;
970
977
971
- return rec ( filter := IsList , element_type := input_types[ 1 ] .element_type.element_type );
978
+ return rec ( filter := filter , element_type := input_types[ 1 ] .element_type.element_type );
972
979
973
980
end );
974
981
@@ -1176,6 +1183,53 @@ CapJitAddTypeSignature( "[,]", [ IsList, IsInt, IsInt ], function ( input_types
1176
1183
1177
1184
end );
1178
1185
1186
+ CapJitAddTypeSignature( " LazyArray" , [ IsInt, IsFunction ] , function ( args, func_stack )
1187
+
1188
+ args := ShallowCopy( args );
1189
+
1190
+ args.2 := CAP_JIT_INTERNAL_INFERRED_DATA_TYPES_OF_FUNCTION_BY_ARGUMENTS_TYPES( args.2 , [ args.1 .data_type ] , func_stack );
1191
+
1192
+ if args.2 = fail then
1193
+
1194
+ # Error( "could not determine output type" );
1195
+ return fail ;
1196
+
1197
+ fi ;
1198
+
1199
+ return rec ( args := args, output_type := rec ( filter := IsLazyArray, element_type := args.2 .data_type.signature[ 2 ] ) );
1200
+
1201
+ end );
1202
+
1203
+ CapJitAddTypeSignature( " LazyStandardInterval" , [ IsInt ] , function ( input_types )
1204
+
1205
+ return rec ( filter := IsLazyArray, element_type := rec ( filter := IsInt ) );
1206
+
1207
+ end );
1208
+
1209
+ CapJitAddTypeSignature( " LazyInterval" , [ IsInt, IsInt ] , function ( input_types )
1210
+
1211
+ return rec ( filter := IsLazyInterval, element_type := rec ( filter := IsInt ) );
1212
+
1213
+ end );
1214
+
1215
+ CapJitAddTypeSignature( " LazyConstantArray" , [ IsInt, IsInt ] , function ( input_types )
1216
+
1217
+ return rec ( filter := IsLazyConstantArray, element_type := rec ( filter := IsInt ) );
1218
+
1219
+ end );
1220
+
1221
+ CapJitAddTypeSignature( " LazyArrayFromList" , [ IsList ] , function ( input_types )
1222
+
1223
+ return rec ( filter := IsLazyArrayFromList, element_type := rec ( filter := IsInt ) );
1224
+
1225
+ end );
1226
+
1227
+ CapJitAddTypeSignature( " ListOfValues" , [ IsLazyArray ] , function ( input_types )
1228
+
1229
+ return rec ( filter := IsList, element_type := rec ( filter := IsInt ) );
1230
+
1231
+ end );
1232
+
1179
1233
CapJitAddTypeSignature( " LazyHList" , [ IsList, IsFunction ] , function ( args, func_stack )
1180
1234
1181
1235
args := ShallowCopy( args );
0 commit comments