Skip to content

Commit 6a2487a

Browse files
bendlasstuarthalloway
authored andcommitted
CLJ-1171 Obey lexical scope for class argument in instance? compiler macro
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
1 parent 357ba72 commit 6a2487a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/jvm/clojure/lang/Compiler.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,11 +3581,14 @@ static public Expr parse(C context, ISeq form) {
35813581
Expr fexpr = analyze(context, form.first());
35823582
if(fexpr instanceof VarExpr && ((VarExpr)fexpr).var.equals(INSTANCE))
35833583
{
3584-
if(RT.second(form) instanceof Symbol)
3584+
Expr sexpr = analyze(C.EXPRESSION, RT.second(form));
3585+
if(sexpr instanceof ConstantExpr)
35853586
{
3586-
Class c = HostExpr.maybeClass(RT.second(form),false);
3587-
if(c != null)
3588-
return new InstanceOfExpr(c, analyze(context, RT.third(form)));
3587+
Object val = ((ConstantExpr) sexpr).val();
3588+
if(val instanceof Class)
3589+
{
3590+
return new InstanceOfExpr((Class) val, analyze(context, RT.third(form)));
3591+
}
35893592
}
35903593
}
35913594

0 commit comments

Comments
 (0)