Why isn't this a type mismatch?
From: https://golang.org/ref/spec#Assignability
A value x is assignable to a variable of type T ("x is assignable to T") in any of these cases: ...snip... x's type V and T have identical underlying types and at least one of V or T is not a named type. ...snip...
Is that because the underlying type of N[] is N[] which is not a named type?
What's the rationale behind it?
package main
import "fmt"
type N []N
func main() {
n := make([]N, 1)
fmt.Printf("%T\n", n)
fmt.Printf("%T\n", n[0])
n[0] = n
//fmt.Println(n)
}
*Output:*
[]main.N
main.N