Why can I directly assign an alias only when it is to a pointer?

Viewed 127
type a struct{}

type b *a
type c a

func main() {
    var _ b = &a{}
    var _ c = a{}
}

Why is the b assignment valid but not the c assignment? I realize the latter is possible with a cast, but I'm wondering what the reasoning for this restriction is.

3 Answers
Related