@@ -733,10 +733,12 @@ func nodeType2(interp *Interpreter, sc *scope, n *node, seen []*node) (t *itype,
733
733
if err != nil {
734
734
return nil , err
735
735
}
736
- for _ , c := range arg .child [:cl ] {
737
- sc .sym [c .ident ] = & symbol {index : - 1 , kind : varTypeSym , typ : typ }
736
+ if typ != nil {
737
+ for _ , c := range arg .child [:cl ] {
738
+ sc .sym [c .ident ] = & symbol {index : - 1 , kind : varTypeSym , typ : typ }
739
+ }
740
+ incomplete = incomplete || typ .incomplete
738
741
}
739
- incomplete = incomplete || typ .incomplete
740
742
}
741
743
742
744
// Handle input parameters.
@@ -747,12 +749,14 @@ func nodeType2(interp *Interpreter, sc *scope, n *node, seen []*node) (t *itype,
747
749
if err != nil {
748
750
return nil , err
749
751
}
750
- args = append (args , typ )
751
- // Several arguments may be factorized on the same field type.
752
- for i := 1 ; i < cl ; i ++ {
752
+ if typ != nil {
753
753
args = append (args , typ )
754
+ // Several arguments may be factorized on the same field type.
755
+ for i := 1 ; i < cl ; i ++ {
756
+ args = append (args , typ )
757
+ }
758
+ incomplete = incomplete || typ .incomplete
754
759
}
755
- incomplete = incomplete || typ .incomplete
756
760
}
757
761
758
762
// Handle returned values.
@@ -764,12 +768,14 @@ func nodeType2(interp *Interpreter, sc *scope, n *node, seen []*node) (t *itype,
764
768
if err != nil {
765
769
return nil , err
766
770
}
767
- rets = append (rets , typ )
768
- // Several arguments may be factorized on the same field type.
769
- for i := 1 ; i < cl ; i ++ {
771
+ if typ != nil {
770
772
rets = append (rets , typ )
773
+ // Several arguments may be factorized on the same field type.
774
+ for i := 1 ; i < cl ; i ++ {
775
+ rets = append (rets , typ )
776
+ }
777
+ incomplete = incomplete || typ .incomplete
771
778
}
772
- incomplete = incomplete || typ .incomplete
773
779
}
774
780
}
775
781
t = funcOf (args , rets , withNode (n ), withScope (sc ))
0 commit comments