private TypedDeclaration resolveQualifiedMemberExpression(
Tree.QualifiedMemberExpression that,
boolean error) {
Tree.Primary p = that.getPrimary();
ProducedType pt = p.getTypeModel();
boolean packageQualified = p instanceof Tree.Package;
boolean check = packageQualified ||
//that.getStaticMethodReference() ||
pt!=null &&
//account for dynamic blocks
(!pt.getType().isUnknown() ||
that.getMemberOperator() instanceof Tree.SpreadOp);
boolean nameNonempty = that.getIdentifier()!=null &&
!that.getIdentifier().getText().equals("");
if (nameNonempty && check) {
TypedDeclaration member;
String name = name(that.getIdentifier());
String container;
boolean ambiguous;
List<ProducedType> signature = that.getSignature();
boolean ellipsis = that.getEllipsis();
if (packageQualified) {
container = "package '" + unit.getPackage().getNameAsString() + "'";
Declaration pm = unit.getPackage()
.getMember(name, signature, ellipsis);
if (pm instanceof TypedDeclaration) {
member = (TypedDeclaration) pm;
}
else {
member = null;
}
ambiguous = false;
}
else {
pt = pt.resolveAliases(); //needed for aliases like "alias Id<T> => T"
TypeDeclaration d = getDeclaration(that, pt);
container = "type '" + d.getName(unit) + "'";
ClassOrInterface ci =
getContainingClassOrInterface(that.getScope());
if (ci!=null && d.inherits(ci) && !(d instanceof NothingType)) {