InvalidTypeSwitch occurs when .(type) is used on an expression that is not of interface type. Example: func f(i int) { switch x := i.(type) {} }