| // Same type in both: OK. |
| // Changing the type is an incompatible change. |
| // i B: changed from int to string |
| // Adding a new type, whether alias or not, is a compatible change. |
| // Change of type for an unexported name doesn't matter... |
| type t string // OK: t isn't part of the API |
| // ...unless it is exposed. |
| // i u: changed from string to int |
| // An exposed, unexported type can be renamed. |
| var V5 u2 // OK: V5 has changed type, but old u1 corresopnds to new u2 |
| // Splitting a single type into two is an incompatible change. |
| Split1 = u2 // OK, since old u1 corresponds to new u2 |
| // This tries to make u1 correspond to u3 |
| // i Split2: changed from u1 to u3 |
| // Merging two types into one is OK. |
| // Merging isn't OK here because a method is lost. |
| // What's really happening here is that old u4 corresponds to new u3, |
| // and new u3's method set is not a superset of old u4's. |