Skip to content

Commit

Permalink
bugfix for DownFlows() & UpFlows() (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
muir committed Apr 12, 2022
1 parent 55ec7ef commit c8be771
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions nject.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,15 @@ func (fm provider) DownFlows() ([]reflect.Type, []reflect.Type) {
}
t := v.Type()
if t.Kind() == reflect.Func {
if fm.group == finalGroup {
switch fm.group {
case finalGroup:
return typesIn(t), nil
default:
return effectiveOutputs(t)
}
return effectiveOutputs(t)
}
if fm.group == invokeGroup && t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func {
return nil, typesIn(t.Elem())
}
return nil, []reflect.Type{t}
}
Expand Down Expand Up @@ -443,10 +448,15 @@ func (fm provider) UpFlows() ([]reflect.Type, []reflect.Type) {
}
t := v.Type()
if t.Kind() == reflect.Func {
if fm.group == finalGroup {
switch fm.group {
case finalGroup:
return nil, typesOut(t)
default:
return effectiveReturns(t)
}
return effectiveReturns(t)
}
if fm.group == invokeGroup && t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func {
return typesOut(t.Elem()), nil
}
return nil, []reflect.Type{t}
}
Expand Down

0 comments on commit c8be771

Please sign in to comment.