Skip to content

Commit

Permalink
Fix for ceylon#336: Interop: set static fields
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Feb 23, 2012
1 parent c0cdbff commit 7369258
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -1427,8 +1427,15 @@ private JCExpression transformAssignment(Node op, Tree.Term leftTerm, JCExpressi
}
} else if (variable && (Decl.isClassAttribute(decl))) {
// must use the setter, nothing to do, unless it's a java field
if(Decl.isJavaField(decl))
result = at(op).Assign(makeQualIdent(lhs, decl.getName()), rhs);
if(Decl.isJavaField(decl)){
if (decl.isStaticallyImportable()) {
// static field
result = at(op).Assign(makeQualIdent(makeQuotedFQIdent(decl.getContainer().getQualifiedNameString()), decl.getName()), rhs);
}else{
// normal field
result = at(op).Assign(makeQualIdent(lhs, decl.getName()), rhs);
}
}
} else if (variable && (decl.isCaptured() || decl.isShared())) {
// must use the qualified setter
lhs = makeQualIdent(lhs, decl.getName());
Expand Down

0 comments on commit 7369258

Please sign in to comment.