MCPcopy Index your code
hub / github.com/clojure/clojure / LocalBinding

Class LocalBinding

src/jvm/clojure/lang/Compiler.java:6526–6575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6524}
6525
6526public static class LocalBinding{
6527 public final Symbol sym;
6528 public final Symbol tag;
6529 public Expr init;
6530 int idx;
6531 public final String name;
6532 public final boolean isArg;
6533 public final PathNode clearPathRoot;
6534 public boolean canBeCleared = !RT.booleanCast(getCompilerOption(disableLocalsClearingKey));
6535 public boolean recurMistmatch = false;
6536 public boolean used = false;
6537
6538 public LocalBinding(int num, Symbol sym, Symbol tag, Expr init, boolean isArg,PathNode clearPathRoot)
6539 {
6540 if(maybePrimitiveType(init) != null && tag != null)
6541 throw new UnsupportedOperationException("Can't type hint a local with a primitive initializer");
6542 this.idx = num;
6543 this.sym = sym;
6544 this.tag = tag;
6545 this.init = init;
6546 this.isArg = isArg;
6547 this.clearPathRoot = clearPathRoot;
6548 name = munge(sym.name);
6549 }
6550
6551 Boolean hjc;
6552
6553 public boolean hasJavaClass() {
6554 if (hjc == null)
6555 {
6556 if(init != null && init.hasJavaClass() && Util.isPrimitive(init.getJavaClass()) && !(init instanceof MaybePrimitiveExpr))
6557 hjc = false;
6558 else
6559 hjc = tag != null || (init != null && init.hasJavaClass());
6560 }
6561 return hjc;
6562 }
6563
6564 Class jc;
6565
6566 public Class getJavaClass() {
6567 if (jc == null)
6568 jc = tag != null ? HostExpr.tagToClass(tag) : init.getJavaClass();
6569 return jc;
6570 }
6571
6572 public Class getPrimitiveType(){
6573 return maybePrimitiveType(init);
6574 }
6575}
6576
6577public static class LocalBindingExpr implements Expr, MaybePrimitiveExpr, AssignableExpr{
6578 public final LocalBinding b;

Callers

nothing calls this directly

Calls 2

booleanCastMethod · 0.95
getCompilerOptionMethod · 0.80

Tested by

no test coverage detected