On Friday, 8 May 2020 16:58:01 UTC+1, Axel Wagner wrote:
>
> I'm happy to report, that I *think* I found an inconsistency with error 
> not being a defined type:
>

Could you explain why error is not a defined type?  Is it something special 
about "error" specifically, or something about interface types in general?

Interface *values* can be assigned interchangeably, even between two 
different defined types:
https://play.golang.org/p/qJd-W6Yj3GA

But that falls out from the assignment rules for interface values:
"A variable of interface type can store a value of any type with a method 
set that is any superset of the interface"

Informally, I think of defined types as "named types".  I don't see 
anything which excludes interface types from being "defined types".  
However, I also can't think of a case when it would make a difference 
whether a named interface type like error is actually a "defined type" or 
not.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1161c416-15f1-4341-9397-d5fddce5f7db%40googlegroups.com.

Reply via email to