title: InvalidChanAssign layout: article

InvalidChanAssign occurs when a chan assignment is invalid.

Per the spec, a value x is assignable to a channel type T if:
 "x is a bidirectional channel value, T is a channel type, x's type V and
 T have identical element types, and at least one of V or T is not a
 defined type."

Example:
 type T1 chan int
 type T2 chan int

 var x T1
 // Invalid assignment because both types are named
 var _ T2 = x