@@ -549,27 +549,36 @@ ${this.ctx.pre}}`;
549549 return callee . value . operator ( callee . value . lhs , rhs ) ;
550550 }
551551
552- if ( ! isMarkedInternal ( callee . value ) ) {
553- const args = argNodes . map ( ( arg ) => this . expression ( arg ) ) ;
554- const shellless = this . ctx . shelllessRepo . get (
555- callee . value as ( ...args : never [ ] ) => unknown ,
556- args ,
557- ) ;
558- if ( shellless ) {
559- const converted = args . map ( ( s , idx ) => {
560- const argType = shellless . argTypes [ idx ] as AnyData ;
561- return tryConvertSnippet ( s , argType , /* verbose */ false ) ;
562- } ) ;
563-
564- return this . ctx . withResetIndentLevel ( ( ) => {
565- const snippet = this . ctx . resolve ( shellless ) ;
566- return snip (
567- stitch `${ snippet . value } (${ converted } )` ,
568- snippet . dataType ,
569- /* origin */ 'runtime' ,
570- ) ;
571- } ) ;
572- }
552+ if ( ! isMarkedInternal ( callee . value ) || isGenericFn ( callee . value ) ) {
553+ const slotPairs = isGenericFn ( callee . value )
554+ ? callee . value [ $providing ] ?. pairs
555+ : [ ] ;
556+ const callback = isGenericFn ( callee . value )
557+ ? callee . value . callback
558+ : ( callee . value as ( ...args : never [ ] ) => unknown ) ;
559+
560+ this . ctx . withSlots ( slotPairs , ( ) => {
561+ const args = argNodes . map ( ( arg ) => this . expression ( arg ) ) ;
562+ const shellless = this . ctx . shelllessRepo . get (
563+ callback ,
564+ args ,
565+ ) ;
566+ if ( shellless ) {
567+ const converted = args . map ( ( s , idx ) => {
568+ const argType = shellless . argTypes [ idx ] as AnyData ;
569+ return tryConvertSnippet ( s , argType , /* verbose */ false ) ;
570+ } ) ;
571+
572+ return this . ctx . withResetIndentLevel ( ( ) => {
573+ const snippet = this . ctx . resolve ( shellless ) ;
574+ return snip (
575+ stitch `${ snippet . value } (${ converted } )` ,
576+ snippet . dataType ,
577+ /* origin */ 'runtime' ,
578+ ) ;
579+ } ) ;
580+ }
581+ } ) ;
573582
574583 throw new Error (
575584 `Function '${
0 commit comments