New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic in related to Bind with a pointer #201
Comments
@shantuo can you take a look? Maybe add a new testcase with this? |
Hi @gracenoah , is your |
In this example Interface is an interface with some methods. I really don't know what's special about it because the panic happens in this one scenario, but I've used wire.Bind elsewhere without it panicking. Sorry that I can't be more helpful. |
No worries, from what I can tell in the stack trace you provided, I don't think this is a bug in |
I think you might be right. I tried to reproduce the issue again by adding back the Bind an changing the constructor to return the struct type and I couldn't. Since, this is all the information we have, I'd be happy with a fix that just adds a better error message whenever this edge case is triggered. Hopefully if it happens again, the error will help me understand the source of the issue. |
It happened to me when I forgot a
instead of
|
Just got a very similar looking panic. This is the exact repro: package main
import "github.com/google/wire"
type A struct {
B string
}
func makeA(string) A {
panic(wire.Build(wire.Struct(new(*A), "*")))
}
|
@gracenoah, thanks for the minimal repro! I'll try to take a look in the next week or so. |
@gracenoah and @anton-dessiatov, it seems like that |
Thanks for investigating and making a separate issue. |
Describe the bug
Panic when running
wire ./...
To Reproduce
Sorry, I can't give a specific repro because
The error was related to a bind statement:
I don't know what was unusual about this bind statement. There was New function that returns a pointer to Concrete and *Concrete implements Interface. In 0.2.2, I was able to use new(Concrete), but I had to change that to new(*Concrete) after upgrading to 0.3.0 and that's when the panic happened.
I hope that the following stack trace helps. If not, we might want to wait for someone to run into this again and provide a repro.
Expected behavior
No panic
Version
0.3.0
Additional context
Sorry, too much proprietary code. Hope there's something obvious that recently changed and the stack trace helps.
The text was updated successfully, but these errors were encountered: