use of org.eclipse.ceylon.model.typechecker.model.Declaration in project ceylon by eclipse.
the class Decl method isPrivateAccessRequiringCompanion.
public static boolean isPrivateAccessRequiringCompanion(Tree.StaticMemberOrTypeExpression qual) {
if (qual instanceof Tree.QualifiedMemberOrTypeExpression) {
Tree.Primary primary = ((Tree.QualifiedMemberOrTypeExpression) qual).getPrimary();
Declaration decl = qual.getDeclaration();
return decl.isMember() && !decl.isShared() && decl.getContainer() instanceof Interface && !Decl.hasScopeInType(decl.getContainer(), primary.getTypeModel());
}
return false;
}
use of org.eclipse.ceylon.model.typechecker.model.Declaration in project ceylon by eclipse.
the class DefiniteAssignmentVisitor method visit.
public void visit(Tree.SpecifierStatement stmt) {
Tree.Term bme = stmt.getBaseMemberExpression();
if (bme instanceof Tree.MemberOrTypeExpression) {
Declaration decl = ((Tree.MemberOrTypeExpression) bme).getDeclaration();
if (// non-variable and deferred
tracked.containsKey(decl) && // specification is in a for/else
forBlock != null && !forBlock.equals(tracked.get(decl))) {
// not declared in *this* for/else
if (elseBlock == null) {
((Value) decl).setSpecifiedInForElse(true);
}
ControlBlock assigningBlock = elseBlock != null ? elseBlock : forBlock;
addSpecified(decl, assigningBlock);
}
}
super.visit(stmt);
}
use of org.eclipse.ceylon.model.typechecker.model.Declaration in project ceylon by eclipse.
the class SmallDeclarationVisitor method visit.
@Override
public void visit(Tree.SpecifierStatement that) {
Declaration d = that.getDeclaration();
if (d == null) {
if (that.getBaseMemberExpression() instanceof Tree.MemberOrTypeExpression) {
d = ((Tree.MemberOrTypeExpression) that.getBaseMemberExpression()).getDeclaration();
}
}
// Declaration prevd = declaration;
// declaration = d;
smallDeclaration(d);
super.visit(that);
// declaration = prevd;
}
use of org.eclipse.ceylon.model.typechecker.model.Declaration in project ceylon by eclipse.
the class SmallVisitor method visit.
@Override
public void visit(Tree.WithinOp that) {
Declaration preva = assigning;
assigning = NON_SMALLABLE;
super.visit(that);
assigning = preva;
if (that.getLowerBound().getSmall() && that.getUpperBound().getSmall() && that.getTerm().getSmall()) {
markSmall(that);
}
}
use of org.eclipse.ceylon.model.typechecker.model.Declaration in project ceylon by eclipse.
the class SmallVisitor method visit.
@Override
public void visit(Tree.AnyMethod that) {
Declaration preva = assigning;
assigning = that.getDeclarationModel().getRefinedDeclaration();
super.visit(that);
assigning = preva;
}
Aggregations