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/compile: type parameter strings are reported inconsistently #49547

Closed
rogpeppe opened this issue Nov 12, 2021 · 2 comments
Closed

cmd/compile: type parameter strings are reported inconsistently #49547

rogpeppe opened this issue Nov 12, 2021 · 2 comments
Labels
FrozenDueToAge generics Issue is related to generics NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rogpeppe
Copy link
Contributor

go version devel go1.18-1ec51087e5 Thu Nov 11 07:03:15 2021 +0000 linux/amd64

I ran the following code: https://gotipplay.golang.org/p/zJqSyWEKLMD

package main

import "fmt"

type foo int

func main() {
	fmt.Printf("%T\n", foo(0))
	f := F[foo]{}
	fmt.Printf("%T\n", f)
}

type F[T any] struct {
}

It prints:

main.foo
main.F["".foo]

I'd expect it to print:

main.foo
main.F[main.foo]

i.e. it should report the type parameter string in the same way that it's reported when the type isn't a parameter.

@rogpeppe rogpeppe added the generics Issue is related to generics label Nov 12, 2021
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 12, 2021
@cagedmantis cagedmantis added this to the Go1.18 milestone Nov 12, 2021
@cagedmantis
Copy link
Contributor

/cc @griesemer

@randall77 randall77 self-assigned this Nov 12, 2021
@gopherbot
Copy link

Change https://golang.org/cl/363656 mentions this issue: cmd/compile: ensure we replace package placeholder in type names

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge generics Issue is related to generics 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