54 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; |
54 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; |
55 |
55 |
56 import static com.sun.tools.javac.code.Flags.*; |
56 import static com.sun.tools.javac.code.Flags.*; |
57 import static com.sun.tools.javac.code.Kinds.*; |
57 import static com.sun.tools.javac.code.Kinds.*; |
58 import static com.sun.tools.javac.code.TypeTag.CLASS; |
58 import static com.sun.tools.javac.code.TypeTag.CLASS; |
|
59 import static com.sun.tools.javac.code.TypeTag.TYPEVAR; |
59 import static com.sun.tools.javac.jvm.ClassFile.*; |
60 import static com.sun.tools.javac.jvm.ClassFile.*; |
60 import static com.sun.tools.javac.jvm.ClassFile.Version.*; |
61 import static com.sun.tools.javac.jvm.ClassFile.Version.*; |
61 |
62 |
62 import static com.sun.tools.javac.main.Option.*; |
63 import static com.sun.tools.javac.main.Option.*; |
63 |
64 |
700 Type restype = sigToType(); |
701 Type restype = sigToType(); |
701 List<Type> thrown = List.nil(); |
702 List<Type> thrown = List.nil(); |
702 while (signature[sigp] == '^') { |
703 while (signature[sigp] == '^') { |
703 sigp++; |
704 sigp++; |
704 thrown = thrown.prepend(sigToType()); |
705 thrown = thrown.prepend(sigToType()); |
|
706 } |
|
707 // if there is a typevar in the throws clause we should state it. |
|
708 for (List<Type> l = thrown; l.nonEmpty(); l = l.tail) { |
|
709 if (l.head.hasTag(TYPEVAR)) { |
|
710 l.head.tsym.flags_field |= THROWS; |
|
711 } |
705 } |
712 } |
706 return new MethodType(argtypes, |
713 return new MethodType(argtypes, |
707 restype, |
714 restype, |
708 thrown.reverse(), |
715 thrown.reverse(), |
709 syms.methodClass); |
716 syms.methodClass); |