changeset 42828 | cce89649f958 |
parent 42827 | 36468b5fa7f4 |
child 42974 | ae7decb33b43 |
42827:36468b5fa7f4 | 42828:cce89649f958 |
---|---|
2345 DiagnosticPosition pos, |
2345 DiagnosticPosition pos, |
2346 Symbol location, |
2346 Symbol location, |
2347 Type site, |
2347 Type site, |
2348 Name name, |
2348 Name name, |
2349 boolean qualified) { |
2349 boolean qualified) { |
2350 return accessInternal(sym, pos, location, site, name, qualified, List.<Type>nil(), null, basicLogResolveHelper); |
2350 return accessInternal(sym, pos, location, site, name, qualified, List.nil(), null, basicLogResolveHelper); |
2351 } |
2351 } |
2352 |
2352 |
2353 /** Same as original accessBase(), but without location. |
2353 /** Same as original accessBase(), but without location. |
2354 */ |
2354 */ |
2355 Symbol accessBase(Symbol sym, |
2355 Symbol accessBase(Symbol sym, |
2691 //- System.out.println(" e " + e.sym); |
2691 //- System.out.println(" e " + e.sym); |
2692 if (sym.kind == MTH && |
2692 if (sym.kind == MTH && |
2693 (sym.flags_field & SYNTHETIC) == 0) { |
2693 (sym.flags_field & SYNTHETIC) == 0) { |
2694 List<Type> oldParams = sym.type.hasTag(FORALL) ? |
2694 List<Type> oldParams = sym.type.hasTag(FORALL) ? |
2695 ((ForAll)sym.type).tvars : |
2695 ((ForAll)sym.type).tvars : |
2696 List.<Type>nil(); |
2696 List.nil(); |
2697 Type constrType = new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams), |
2697 Type constrType = new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams), |
2698 types.createMethodTypeWithReturn(sym.type.asMethodType(), site)); |
2698 types.createMethodTypeWithReturn(sym.type.asMethodType(), site)); |
2699 MethodSymbol newConstr = new MethodSymbol(sym.flags(), names.init, constrType, site.tsym) { |
2699 MethodSymbol newConstr = new MethodSymbol(sym.flags(), names.init, constrType, site.tsym) { |
2700 @Override |
2700 @Override |
2701 public Symbol baseSymbol() { |
2701 public Symbol baseSymbol() { |
2719 Name name) { |
2719 Name name) { |
2720 |
2720 |
2721 site = types.capture(site); |
2721 site = types.capture(site); |
2722 |
2722 |
2723 ReferenceLookupHelper lookupHelper = makeReferenceLookupHelper( |
2723 ReferenceLookupHelper lookupHelper = makeReferenceLookupHelper( |
2724 referenceTree, site, name, List.<Type>nil(), null, VARARITY); |
2724 referenceTree, site, name, List.nil(), null, VARARITY); |
2725 |
2725 |
2726 Env<AttrContext> newEnv = env.dup(env.tree, env.info.dup()); |
2726 Env<AttrContext> newEnv = env.dup(env.tree, env.info.dup()); |
2727 Symbol sym = lookupMethod(newEnv, env.tree.pos(), site.tsym, |
2727 Symbol sym = lookupMethod(newEnv, env.tree.pos(), site.tsym, |
2728 nilMethodCheck, lookupHelper); |
2728 nilMethodCheck, lookupHelper); |
2729 |
2729 |
3273 |
3273 |
3274 @Override |
3274 @Override |
3275 protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { |
3275 protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { |
3276 WriteableScope sc = WriteableScope.create(syms.arrayClass); |
3276 WriteableScope sc = WriteableScope.create(syms.arrayClass); |
3277 MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym); |
3277 MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym); |
3278 arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass); |
3278 arrayConstr.type = new MethodType(List.of(syms.intType), site, List.nil(), syms.methodClass); |
3279 sc.enter(arrayConstr); |
3279 sc.enter(arrayConstr); |
3280 return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false); |
3280 return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false); |
3281 } |
3281 } |
3282 |
3282 |
3283 @Override |
3283 @Override |
3660 Symbol location, |
3660 Symbol location, |
3661 Type site, |
3661 Type site, |
3662 Name name, |
3662 Name name, |
3663 List<Type> argtypes, |
3663 List<Type> argtypes, |
3664 List<Type> typeargtypes) { |
3664 List<Type> typeargtypes) { |
3665 argtypes = argtypes == null ? List.<Type>nil() : argtypes; |
3665 argtypes = argtypes == null ? List.nil() : argtypes; |
3666 typeargtypes = typeargtypes == null ? List.<Type>nil() : typeargtypes; |
3666 typeargtypes = typeargtypes == null ? List.nil() : typeargtypes; |
3667 if (name == names.error) |
3667 if (name == names.error) |
3668 return null; |
3668 return null; |
3669 |
3669 |
3670 boolean hasLocation = false; |
3670 boolean hasLocation = false; |
3671 if (location == null) { |
3671 if (location == null) { |