src/share/classes/com/sun/tools/javac/comp/Attr.java

changeset 774
56f59723fddf
parent 770
aa6605d883dc
child 780
1d625fbe6c22
equal deleted inserted replaced
773:5fb14e67c371 774:56f59723fddf
2887 } 2887 }
2888 result = check(tree, owntype, TYP, pkind, pt); 2888 result = check(tree, owntype, TYP, pkind, pt);
2889 } 2889 }
2890 2890
2891 public void visitTypeDisjunction(JCTypeDisjunction tree) { 2891 public void visitTypeDisjunction(JCTypeDisjunction tree) {
2892 List<Type> alternatives = attribTypes(tree.alternatives, env); 2892 ListBuffer<Type> multicatchTypes = ListBuffer.lb();
2893 tree.type = result = check(tree, types.lub(alternatives), TYP, pkind, pt); 2893 for (JCExpression typeTree : tree.alternatives) {
2894 Type ctype = attribType(typeTree, env);
2895 ctype = chk.checkType(typeTree.pos(),
2896 chk.checkClassType(typeTree.pos(), ctype),
2897 syms.throwableType);
2898 multicatchTypes.append(ctype);
2899 }
2900 tree.type = result = check(tree, types.lub(multicatchTypes.toList()), TYP, pkind, pt);
2894 } 2901 }
2895 2902
2896 public void visitTypeParameter(JCTypeParameter tree) { 2903 public void visitTypeParameter(JCTypeParameter tree) {
2897 TypeVar a = (TypeVar)tree.type; 2904 TypeVar a = (TypeVar)tree.type;
2898 Set<Type> boundSet = new HashSet<Type>(); 2905 Set<Type> boundSet = new HashSet<Type>();

mercurial