public void setAttr(State s, @NotNull Type v) { Type targetType = transformExpr(target, s); if (targetType.isUnionType()) { Set<Type> types = targetType.asUnionType().types; for (Type tp : types) { setAttrType(tp, v); } } else { setAttrType(targetType, v); } }
@NotNull @Override public Type transform(State s) { // the form of ::A in ruby if (target == null) { return transformExpr(attr, s); } Type targetType = transformExpr(target, s); if (targetType.isUnionType()) { Set<Type> types = targetType.asUnionType().types; Type retType = Type.UNKNOWN; for (Type tt : types) { retType = UnionType.union(retType, getAttrType(tt)); } return retType; } else { return getAttrType(targetType); } }