|
575 | 575 | closure-idx (get-in new-cb (conj parents :syms ob))] |
576 | 576 | closure-idx)) |
577 | 577 |
|
| 578 | +(defn resolve-type-hint [ctx t] |
| 579 | + (or (interop/resolve-type-hint ctx t) |
| 580 | + (records/resolve-record-class ctx t) |
| 581 | + (throw-error-with-location |
| 582 | + (str "Unable to resolve classnamex: " t) t))) |
| 583 | + |
578 | 584 | (defn analyze-let* |
579 | 585 | [ctx expr destructured-let-bindings exprs] |
580 | 586 | (if (> (count destructured-let-bindings) |
|
601 | 607 | binding-name (if (symbol? t) |
602 | 608 | (vary-meta binding-name |
603 | 609 | assoc :tag-class |
604 | | - (delay (or (interop/resolve-type-hint ctx t) |
605 | | - (records/resolve-record-class ctx t) |
606 | | - (throw-error-with-location |
607 | | - (str "Unable to resolve classnamex: " t) t)))) |
| 610 | + (delay (resolve-type-hint ctx t))) |
608 | 611 | binding-name)]) |
609 | 612 | v (analyze ctx binding-value) |
610 | 613 | new-iden (gensym) |
|
1062 | 1065 | has-types? (volatile! nil)])] |
1063 | 1066 | #?(:clj (when arg-types |
1064 | 1067 | (areduce args idx _ret nil |
1065 | | - (when-let [t (:tag-class (meta (aget args idx)))] |
1066 | | - (vreset! has-types? true) |
1067 | | - (aset arg-types idx (force t)))))) |
| 1068 | + (let [arg-meta (meta (aget args idx))] |
| 1069 | + (if-let [t (:tag-class arg-meta)] |
| 1070 | + (do (vreset! has-types? true) |
| 1071 | + (aset arg-types idx (force t))) |
| 1072 | + (when-let [t (:tag arg-meta)] |
| 1073 | + (let [t (resolve-type-hint ctx t)] |
| 1074 | + (do (vreset! has-types? true) |
| 1075 | + (aset arg-types idx (force t)))))))))) |
1068 | 1076 | (with-meta (sci.impl.types/->Node |
1069 | 1077 | (eval/eval-instance-method-invocation |
1070 | 1078 | ctx bindings instance-expr meth-name field-access args arg-count |
|
0 commit comments