gopherdata/gophernotes

Inconsistent behavior w/ reflect.TypeOf

icncsx opened this issue · 1 comments

type T string

t := T("what")
tt := reflect.TypeOf(t)
fmt.Println(tt) // prints string, should be main.T

This is a known limitation:
Go standard library does not provide any way to create new named types at runtime - only new unnamed types can be created.

Thus it's currently not possible to fix this issue.

There is an open enhancement proposal golang/go#39717 for adding such feature to Go standard library - I started implementing it some months ago, but it's still unfinished