Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

Problem

Typed Clojure uses local type argument synthesis to automatically synthesise type arguments to polymorphic functions. Some inference cases are hard to synthesise, which usually cause the inference engine to fail.

These cases require manual annotation of type arguments, which are potentially different at every function application.

Solution

I require particular reader metadata to survive analysis, probably attached to a symbol presenting a function in the operator position of an invocation.

Current Behaviour

(ast macro from `analyze`)
 
Current behaviour:
 
typed.core=> (ast float?)
{:op :var, :env {:locals {}, :ns {:name typed.core}}, :var #'clojure.core/float?, :tag nil}



 

Proposal

analyze.core=> (-> (ast                      (^{:a :b :tag Number} float? 1))                 pprint){:args ({:op :number, :env {:locals {}, :ns {:name analyze.core}}, :val 1}), :op :invoke, :protocol-on nil, :is-protocol false, :fexpr {:op :var,  :env {:locals {}, :ns {:name analyze.core}},  :var  #<Var@1e0a283:     #<core$float_QMARK_ clojure.core$float_QMARK_@b45130>>,  :tag Number}, :is-direct false, :env {:source "REPL", :line 19, :locals {}, :ns {:name analyze.core}}, :site-index -1, :tag Number}nil

 
Labels: