NEW RULES
UnionType and IntersectionType are going to go away, so code which does type.getDeclaration() instanceof UnionType is now officially going to break!
same with code that does type.getDeclaration().getCaseTypes(), type.getDeclaration().geSatisfiedTypes() etc
you now have to avoid calling ProducedType.getDeclaration() unless you absolutely have to, and except when you already know you have something that is not a union or intersection.
Instead, use type.isUnion(), type.isIntersection(), type.getSatisfiedTypes(), etc.
NEW RULES
UnionTypeandIntersectionTypeare going to go away, so code which doestype.getDeclaration() instanceof UnionTypeis now officially going to break!same with code that does
type.getDeclaration().getCaseTypes(),type.getDeclaration().geSatisfiedTypes()etcyou now have to avoid calling
ProducedType.getDeclaration()unless you absolutely have to, and except when you already know you have something that is not a union or intersection.Instead, use
type.isUnion(),type.isIntersection(),type.getSatisfiedTypes(), etc.