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
generics NeedsInvestigation
Milestone

Comments

@rogpeppe
Copy link
Contributor

@rogpeppe rogpeppe commented Nov 12, 2021

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 label Nov 12, 2021
@cagedmantis cagedmantis added the NeedsInvestigation label Nov 12, 2021
@cagedmantis cagedmantis added this to the Go1.18 milestone Nov 12, 2021
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Nov 12, 2021

/cc @griesemer

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

@gopherbot gopherbot commented Nov 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generics NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

4 participants