@@ -317,6 +317,23 @@ addObject(BUILTIN_SHAPES, BuiltInArrayId, [
317
317
mutableOnlyIfOperandsAreMutable : true ,
318
318
} ) ,
319
319
] ,
320
+ [
321
+ 'flatMap' ,
322
+ addFunction ( BUILTIN_SHAPES , [ ] , {
323
+ positionalParams : [ ] ,
324
+ restParam : Effect . ConditionallyMutate ,
325
+ returnType : { kind : 'Object' , shapeId : BuiltInArrayId } ,
326
+ /*
327
+ * callee is ConditionallyMutate because items of the array
328
+ * flow into the lambda and may be mutated there, even though
329
+ * the array object itself is not modified
330
+ */
331
+ calleeEffect : Effect . ConditionallyMutate ,
332
+ returnValueKind : ValueKind . Mutable ,
333
+ noAlias : true ,
334
+ mutableOnlyIfOperandsAreMutable : true ,
335
+ } ) ,
336
+ ] ,
320
337
[
321
338
'filter' ,
322
339
addFunction ( BUILTIN_SHAPES , [ ] , {
@@ -534,6 +551,17 @@ addObject(BUILTIN_SHAPES, BuiltInMixedReadonlyId, [
534
551
noAlias : true ,
535
552
} ) ,
536
553
] ,
554
+ [
555
+ 'flatMap' ,
556
+ addFunction ( BUILTIN_SHAPES , [ ] , {
557
+ positionalParams : [ ] ,
558
+ restParam : Effect . Read ,
559
+ returnType : { kind : 'Object' , shapeId : BuiltInArrayId } ,
560
+ calleeEffect : Effect . ConditionallyMutate ,
561
+ returnValueKind : ValueKind . Mutable ,
562
+ noAlias : true ,
563
+ } ) ,
564
+ ] ,
537
565
[
538
566
'filter' ,
539
567
addFunction ( BUILTIN_SHAPES , [ ] , {
0 commit comments