diff --git a/container/container.go b/container/container.go index 700b6b88c..3ced7ff04 100644 --- a/container/container.go +++ b/container/container.go @@ -214,9 +214,10 @@ func (c *container) addNode(provider *ProviderDescriptor, key *moduleKey) (inter } vr = &simpleResolver{ - node: sp, - typ: typ, - graphNode: typeGraphNode, + node: sp, + typ: typ, + graphNode: typeGraphNode, + idxInValues: i, } c.resolvers[typ] = vr } diff --git a/container/container_test.go b/container/container_test.go index 15d8d1a3b..3eb7e367b 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -461,6 +461,7 @@ type TestOutput struct { container.Out X string + Y int64 } func TestStructArgs(t *testing.T) { @@ -485,11 +486,12 @@ func TestStructArgs(t *testing.T) { )) require.NoError(t, container.Run( - func(x string) { + func(x string, y int64) { require.Equal(t, "A", x) + require.Equal(t, int64(-10), y) }, container.Provide(func() (TestOutput, error) { - return TestOutput{X: "A"}, nil + return TestOutput{X: "A", Y: -10}, nil }), ))