|
864 | 864 | :impls #{}}) |
865 | 865 | (when fn-var? |
866 | 866 | (let [params (map #(vec (map :name (:params %))) (:methods init-expr))] |
867 | | - {:fn-var true |
868 | | - ;; protocol implementation context |
869 | | - :protocol-impl (:protocol-impl init-expr) |
870 | | - ;; inline protocol implementation context |
871 | | - :protocol-inline (:protocol-inline init-expr) |
872 | | - :variadic (:variadic init-expr) |
873 | | - :max-fixed-arity (:max-fixed-arity init-expr) |
874 | | - :method-params params |
875 | | - :arglists (:arglists sym-meta) |
876 | | - :arglists-meta (doall (map meta (:arglists sym-meta))) |
877 | | - :methods (map (fn [method] |
878 | | - (let [tag (infer-tag env (assoc method :op :method))] |
879 | | - (cond-> (select-keys method |
880 | | - [:max-fixed-arity :variadic]) |
881 | | - tag (assoc :tag tag)))) |
882 | | - (:methods init-expr))}) ) |
| 867 | + (merge |
| 868 | + {:fn-var true |
| 869 | + ;; protocol implementation context |
| 870 | + :protocol-impl (:protocol-impl init-expr) |
| 871 | + ;; inline protocol implementation context |
| 872 | + :protocol-inline (:protocol-inline init-expr)} |
| 873 | + (if-let [top-fn-meta (:top-fn sym-meta)] |
| 874 | + top-fn-meta |
| 875 | + {:variadic (:variadic init-expr) |
| 876 | + :max-fixed-arity (:max-fixed-arity init-expr) |
| 877 | + :method-params params |
| 878 | + :arglists (:arglists sym-meta) |
| 879 | + :arglists-meta (doall (map meta (:arglists sym-meta)))}))) ) |
883 | 880 | (when (and fn-var? tag) |
884 | 881 | {:ret-tag tag}))) |
885 | 882 | (merge |
|
978 | 975 | :fn-var true |
979 | 976 | :variadic variadic |
980 | 977 | :max-fixed-arity max-fixed-arity |
981 | | - :method-params (map :params methods) |
982 | | - :methods methods) |
| 978 | + :method-params (map :params methods)) |
983 | 979 | locals) |
984 | 980 | methods (if name |
985 | 981 | ;; a second pass with knowledge of our function-ness/arity |
|
1027 | 1023 | :shadow (locals n) |
1028 | 1024 | :variadic (:variadic fexpr) |
1029 | 1025 | :max-fixed-arity (:max-fixed-arity fexpr) |
1030 | | - :method-params (map :params (:methods fexpr)) |
1031 | | - :methods (:methods fexpr)} |
| 1026 | + :method-params (map :params (:methods fexpr))} |
1032 | 1027 | ret-tag (assoc :ret-tag ret-tag))] |
1033 | 1028 | [(assoc-in env [:locals n] be) |
1034 | 1029 | (conj bes be)])) |
|
1043 | 1038 | :init fexpr |
1044 | 1039 | :variadic (:variadic fexpr) |
1045 | 1040 | :max-fixed-arity (:max-fixed-arity fexpr) |
1046 | | - :method-params (map :params (:methods fexpr)) |
1047 | | - :methods (:methods fexpr))] |
| 1041 | + :method-params (map :params (:methods fexpr)))] |
1048 | 1042 | [(assoc-in env [:locals name] be') |
1049 | 1043 | (conj bes be')])) |
1050 | 1044 | [meth-env []] bes) |
|
1102 | 1096 | {:fn-var true |
1103 | 1097 | :variadic (:variadic init-expr) |
1104 | 1098 | :max-fixed-arity (:max-fixed-arity init-expr) |
1105 | | - :method-params (map :params (:methods init-expr)) |
1106 | | - :methods (:methods init-expr)}) |
| 1099 | + :method-params (map :params (:methods init-expr))}) |
1107 | 1100 | be)] |
1108 | 1101 | (recur (conj bes be) |
1109 | 1102 | (assoc-in env [:locals name] be) |
|
0 commit comments