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

Method constantType

src/jvm/clojure/lang/Compiler.java:5818–5842  ·  view source on GitHub ↗
(int id)

Source from the content-addressed store, hash-verified

5816 }
5817
5818 Type constantType(int id){
5819 Object o = constants.nth(id);
5820 Class c = clojure.lang.Util.classOf(o);
5821 if(c!= null && Modifier.isPublic(c.getModifiers()))
5822 {
5823 //can't emit derived fn types due to visibility
5824 if(LazySeq.class.isAssignableFrom(c))
5825 return Type.getType(ISeq.class);
5826 else if(c == Keyword.class)
5827 return Type.getType(Keyword.class);
5828// else if(c == KeywordCallSite.class)
5829// return Type.getType(KeywordCallSite.class);
5830 else if(RestFn.class.isAssignableFrom(c))
5831 return Type.getType(RestFn.class);
5832 else if(AFn.class.isAssignableFrom(c))
5833 return Type.getType(AFn.class);
5834 else if(c == Var.class)
5835 return Type.getType(Var.class);
5836 else if(c == String.class)
5837 return Type.getType(String.class);
5838
5839// return Type.getType(c);
5840 }
5841 return OBJECT_TYPE;
5842 }
5843
5844}
5845

Callers 4

compileMethod · 0.95
emitConstantsMethod · 0.95
emitConstantMethod · 0.95
compileMethod · 0.95

Calls 4

getTypeMethod · 0.95
classOfMethod · 0.80
isPublicMethod · 0.80
nthMethod · 0.65

Tested by

no test coverage detected