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

changeset 1570
f91144b7da75
parent 1521
71f35e4b93a5
child 1690
76537856a54e
equal deleted inserted replaced
1569:475eb15dfdad 1570:f91144b7da75
1 /* 1 /*
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
481 try { 481 try {
482 currentMethod = tree; 482 currentMethod = tree;
483 tree.restype = translate(tree.restype, null); 483 tree.restype = translate(tree.restype, null);
484 tree.typarams = List.nil(); 484 tree.typarams = List.nil();
485 tree.params = translateVarDefs(tree.params); 485 tree.params = translateVarDefs(tree.params);
486 tree.recvparam = translate(tree.recvparam, null);
486 tree.thrown = translate(tree.thrown, null); 487 tree.thrown = translate(tree.thrown, null);
487 tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType()); 488 tree.body = translate(tree.body, tree.sym.erasure(types).getReturnType());
488 tree.type = erasure(tree.type); 489 tree.type = erasure(tree.type);
489 result = tree; 490 result = tree;
490 } finally { 491 } finally {
547 JCTree prevMethod = currentMethod; 548 JCTree prevMethod = currentMethod;
548 try { 549 try {
549 currentMethod = null; 550 currentMethod = null;
550 tree.params = translate(tree.params); 551 tree.params = translate(tree.params);
551 tree.body = translate(tree.body, null); 552 tree.body = translate(tree.body, null);
552 //save non-erased target
553 tree.targetType = tree.type;
554 Assert.check(!tree.targetType.isCompound(), "Intersection-type targets not supported yet!");
555 tree.type = erasure(tree.type); 553 tree.type = erasure(tree.type);
556 result = tree; 554 result = tree;
557 } 555 }
558 finally { 556 finally {
559 currentMethod = prevMethod; 557 currentMethod = prevMethod;
783 } 781 }
784 } 782 }
785 783
786 public void visitReference(JCMemberReference tree) { 784 public void visitReference(JCMemberReference tree) {
787 tree.expr = translate(tree.expr, null); 785 tree.expr = translate(tree.expr, null);
788 //save non-erased target
789 tree.targetType = tree.type;
790 Assert.check(!tree.targetType.isCompound(), "Intersection-type targets not supported yet!");
791 tree.type = erasure(tree.type); 786 tree.type = erasure(tree.type);
792 result = tree; 787 result = tree;
793 } 788 }
794 789
795 public void visitTypeArray(JCArrayTypeTree tree) { 790 public void visitTypeArray(JCArrayTypeTree tree) {

mercurial