equal
deleted
inserted
replaced
2456 //if the qualifier is a type, validate it |
2456 //if the qualifier is a type, validate it |
2457 chk.validate(that.expr, env); |
2457 chk.validate(that.expr, env); |
2458 } |
2458 } |
2459 |
2459 |
2460 //attrib type-arguments |
2460 //attrib type-arguments |
2461 List<Type> typeargtypes = null; |
2461 List<Type> typeargtypes = List.nil(); |
2462 if (that.typeargs != null) { |
2462 if (that.typeargs != null) { |
2463 typeargtypes = attribTypes(that.typeargs, localEnv); |
2463 typeargtypes = attribTypes(that.typeargs, localEnv); |
2464 } |
2464 } |
2465 |
2465 |
2466 Type target; |
2466 Type target; |
2521 if (targetError) { |
2521 if (targetError) { |
2522 resultInfo.checkContext.report(that, diag); |
2522 resultInfo.checkContext.report(that, diag); |
2523 } else { |
2523 } else { |
2524 log.report(diag); |
2524 log.report(diag); |
2525 } |
2525 } |
|
2526 result = that.type = types.createErrorType(target); |
|
2527 return; |
|
2528 } |
|
2529 } |
|
2530 |
|
2531 if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { |
|
2532 if (refSym.isStatic() && TreeInfo.isStaticSelector(that.expr, names) && |
|
2533 exprType.getTypeArguments().nonEmpty()) { |
|
2534 //static ref with class type-args |
|
2535 log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()), |
|
2536 diags.fragment("static.mref.with.targs")); |
|
2537 result = that.type = types.createErrorType(target); |
|
2538 return; |
|
2539 } |
|
2540 |
|
2541 if (refSym.isStatic() && !TreeInfo.isStaticSelector(that.expr, names) && |
|
2542 !lookupHelper.referenceKind(refSym).isUnbound()) { |
|
2543 //no static bound mrefs |
|
2544 log.error(that.expr.pos(), "invalid.mref", Kinds.kindName(that.getMode()), |
|
2545 diags.fragment("static.bound.mref")); |
2526 result = that.type = types.createErrorType(target); |
2546 result = that.type = types.createErrorType(target); |
2527 return; |
2547 return; |
2528 } |
2548 } |
2529 } |
2549 } |
2530 |
2550 |