File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
packages/malloy/src/dialect/functions Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -746,21 +746,18 @@ export function wrapDef(
746
746
const generic : { [ name : string ] : TypeDescElementBlueprintOrNamedGeneric [ ] } =
747
747
{ } ;
748
748
for ( const argVal of Object . values ( takes ) ) {
749
- const genericRefs = Array . from ( tdLeafTypes ( argVal ) ) . filter (
750
- ( t : TypeDescBlueprint ) : t is NamedGeneric => {
751
- return typeof t !== 'string' && 'generic' in t ;
749
+ for ( const leafType of tdLeafTypes ( argVal ) ) {
750
+ if ( typeof leafType !== 'string' && 'generic' in leafType ) {
751
+ generic [ leafType . generic ] = [ 'any' ] ;
752
752
}
753
- ) ;
754
- for ( const genericRef of genericRefs ) {
755
- generic [ genericRef . generic ] = [ 'any' ] ;
756
753
}
757
754
}
758
755
const newDef : DefinitionBlueprint = {
759
756
takes,
760
757
returns,
761
758
impl : { function : name . toUpperCase ( ) } ,
762
759
} ;
763
- // avoids constructing an erray just to test the length
760
+ // avoids constructing an array just to test the length
764
761
for ( const _atLeastOneGeneric in generic ) {
765
762
newDef . generic = generic ;
766
763
break ;
You can’t perform that action at this time.
0 commit comments