lang: ast: Save the non-polyfunc args

We probably want to save these args too in case.
This commit is contained in:
James Shubin
2023-12-16 14:25:41 -05:00
parent a6d22a5a4b
commit 6a6546db8d

View File

@@ -6984,6 +6984,16 @@ func (obj *ExprFunc) SetType(typ *types.Type) error {
}
// Cmp doesn't compare arg names.
typ = newTyp // check it's compatible down below...
} else {
// Even if it's not polymorphic, we'd like to use the
// real arg names of that function, in case they don't
// get passed through type unification somehow...
// (There can be an AST bug that this would prevent.)
sig := obj.function.Info().Sig
if sig == nil {
return fmt.Errorf("could not read nil expr func sig")
}
typ = sig // check it's compatible down below...
}
}