runtime: display fully-qualified types when strings are equal in unequal type panic #11634
go version devel +bd45bce Wed Jul 8 01:20:02 2015 +0000 linux/amd64
Ubuntu 15.04, amd64
Created a test case to see what would happen when vendoring the same package twice in two different repositories.
go15vendortest has a copy of vendortedthing under the vendor directory
A type exception with a way to tell which type came from which package.
panic: interface conversion: interface is vendoredthing.Data, not vendoredthing.Data
I know why this is happening because I created it on purpose, but there seems to be no way to display where these types came from.
This is unrelated to vendoring. This happens if you just have two packages x/y and z/y that define different y.T's.
Here is a shorter example:
99% of the time you do want to see the shortened name. And in general reconstructing an expanded name may be difficult. For example the type involved might actually be
That's not to say we shouldn't do it, just that it's actually hard.
changed the title
cmd/compile: Type name display ambiguity when using vendoring - " interface is vendoredthing.Data, not vendoredthing.Data"
Nov 4, 2015
referenced this issue
Jan 5, 2018
In #17283, we had discussed changing the error to something like:
but we were only considering the case of bare declared types. This solution doesn't extend to compound type literals though that might contain multiple declared types.
It's also not clear that it's always appropriate for single declared types. For example, expanding