Skip to content
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: pkg names collision after import with rename #39853

Closed
kovetskiy opened this issue Jun 25, 2020 · 2 comments
Closed

cmd/go2go: pkg names collision after import with rename #39853

kovetskiy opened this issue Jun 25, 2020 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@kovetskiy
Copy link

kovetskiy commented Jun 25, 2020

go version devel +4dfbf5ab9c7 Thu Jun 25 02:57:14 2020 +0000 linux/amd64

main.go:

package main

import (
        lib1 "bug/lib1"
        lib2 "bug/lib2"
)

func main() {
        impl1 := lib1.Bug(int){X: 1}
        impl2 := lib2.Bug(int){X: 1}
        _ = impl1
        _ = impl2
}

lib1/a.go and lib2.go are identical:

package lib

type Bug(type T) struct {
        X T
}
$ go tool go2go build
a.go2:5: lib redeclared as imported package name
        previous declaration at a.go2:5
a.go2:4: instantiate୦lib୦Bug୦int redeclared in this block
        previous declaration at a.go2:13
/usr/lib/go/bin/go [build] failed: exit status 2
@cagedmantis cagedmantis changed the title [generics] pkg names collision after import with rename cmd/go2go: pkg names collision after import with rename Jun 25, 2020
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 25, 2020
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jun 25, 2020
@ianlancetaylor
Copy link
Contributor

Thanks. This is a bug in the translation tool that lets people experiment with generics. I'll leave this issue open, but I don't expect to fix this. While experimenting with generics, don't rename your imports. If someone else wants to fix it, that would be fine.

@ALTree
Copy link
Member

ALTree commented Jul 30, 2021

The go2go branch is no longer maintained:

This branch was published in 2020 and is no longer being maintained. The generics proposal has been accepted and development is now focused on implementing the proposal in the ordinary Go tools.

So I think we can close here.

@ALTree ALTree closed this as completed Jul 30, 2021
@golang golang locked and limited conversation to collaborators Jul 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants