Skip to content

Commit

Permalink
lang: ast: Save the non-polyfunc args
Browse files Browse the repository at this point in the history
We probably want to save these args too in case.
  • Loading branch information
purpleidea committed Dec 16, 2023
1 parent a6d22a5 commit 6a6546d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lang/ast/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...
}
}

Expand Down

0 comments on commit 6a6546d

Please sign in to comment.