1 /* |
1 /* |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 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 |
26 package com.sun.tools.javac.comp; |
26 package com.sun.tools.javac.comp; |
27 |
27 |
28 import com.sun.tools.javac.code.*; |
28 import com.sun.tools.javac.code.*; |
29 import com.sun.tools.javac.tree.*; |
29 import com.sun.tools.javac.tree.*; |
30 import com.sun.tools.javac.util.*; |
30 import com.sun.tools.javac.util.*; |
|
31 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; |
31 import com.sun.tools.javac.code.Symbol.*; |
32 import com.sun.tools.javac.code.Symbol.*; |
32 import com.sun.tools.javac.code.Type.*; |
33 import com.sun.tools.javac.code.Type.*; |
33 import com.sun.tools.javac.comp.Attr.ResultInfo; |
34 import com.sun.tools.javac.comp.Attr.ResultInfo; |
34 import com.sun.tools.javac.comp.Infer.InferenceContext; |
35 import com.sun.tools.javac.comp.Infer.InferenceContext; |
35 import com.sun.tools.javac.comp.Resolve.MethodResolutionPhase; |
36 import com.sun.tools.javac.comp.Resolve.MethodResolutionPhase; |
529 } |
530 } |
530 JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), env, |
531 JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), env, |
531 attr.memberReferenceQualifierResult(tree)); |
532 attr.memberReferenceQualifierResult(tree)); |
532 ListBuffer<Type> argtypes = ListBuffer.lb(); |
533 ListBuffer<Type> argtypes = ListBuffer.lb(); |
533 for (Type t : types.findDescriptorType(pt).getParameterTypes()) { |
534 for (Type t : types.findDescriptorType(pt).getParameterTypes()) { |
534 argtypes.append(syms.errType); |
535 argtypes.append(Type.noType); |
535 } |
536 } |
536 JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree); |
537 JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree); |
537 mref2.expr = exprTree; |
538 mref2.expr = exprTree; |
538 Pair<Symbol, ?> lookupRes = |
539 Pair<Symbol, ?> lookupRes = |
539 rs.resolveMemberReference(tree, env, mref2, exprTree.type, tree.name, argtypes.toList(), null, true); |
540 rs.resolveMemberReference(tree, env, mref2, exprTree.type, |
|
541 tree.name, argtypes.toList(), null, true, rs.arityMethodCheck); |
540 switch (lookupRes.fst.kind) { |
542 switch (lookupRes.fst.kind) { |
541 //note: as argtypes are erroneous types, type-errors must |
543 //note: as argtypes are erroneous types, type-errors must |
542 //have been caused by arity mismatch |
544 //have been caused by arity mismatch |
543 case Kinds.ABSENT_MTH: |
545 case Kinds.ABSENT_MTH: |
544 case Kinds.WRONG_MTH: |
546 case Kinds.WRONG_MTH: |