Merge pull request #16902 from justinsb/fix_method_matching_render

chore: fix method-matching on Render method
This commit is contained in:
Kubernetes Prow Robot 2024-10-13 19:44:20 +01:00 committed by GitHub
commit b44e9ab488
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -209,14 +209,14 @@ func (c *Context[T]) Render(a, e, changes Task[T]) error {
var args []reflect.Value
for j := 0; j < method.Type.NumIn(); j++ {
arg := method.Type.In(j)
if arg.ConvertibleTo(vType) {
if vType.ConvertibleTo(arg) {
continue
}
if arg.ConvertibleTo(typeContextPtr) {
if typeContextPtr.ConvertibleTo(arg) {
args = append(args, reflect.ValueOf(c))
continue
}
if arg.ConvertibleTo(targetType) {
if targetType.ConvertibleTo(arg) {
args = append(args, reflect.ValueOf(c.Target))
continue
}