func isDirectlyAssignable(inType, outType *types.Type) bool { // TODO: This should maybe check for actual assignability between the two // types, rather than superficial traits that happen to indicate it is // assignable in the ways we currently use this code. return inType.IsAssignable() && (inType.IsPrimitive() || isSamePackage(inType, outType)) }