-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
cmd/go2go: instantiate types from different packages? #40977
Comments
This is confusion as to whether your config.go2 file is using square brackets or parentheses. We'll get this fixed at some point. In the meantime use |
Feeling really stupid, but still:
|
Are you on the tip of the dev.go2go branch? If you are, show me a complete test case. With the test case I created based on the fragments you showed above, adding |
The two files in question are in https://github.com/andig/evcc/pull/307/files. Both combined into a single go playground are fine: https://go2goplay.golang.org/p/y0MoIvA-ZVd. Probably not worth spending more time, I'll wait for the experiment to mature more and hopefully make into mainline soonish. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This may likely not be supported yet, but I'm trying to declare a generic in one package and use it from another:
registry.go2:
and
config.go2:
What did you expect to see?
Transpile the consuming side without error.
What did you see instead?
After registry.go2 is transpiled, config.go2 transpiling fails:
Having everything in a single playground file works fine: https://go2goplay.golang.org/p/OAJT9nCTv0u
Btw: the square brackets syntax seems much easier to read than the repeated rounded brackets used in the examples before. Dropping type seems logical and further reduces cognitive load. Playground2
gofmt
still adds thetype
back in, hope this can be dropped in the future.The text was updated successfully, but these errors were encountered: