Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.38k stars 88 forks source link

Loose type inference on functions that are type hinted #307

Open dupuchba opened 3 months ago

dupuchba commented 3 months ago

When type hinting a function and using it, compiler looses all type inference informations. Spend some type debugging it but it should probably go into the bigger fn refactor.

(defn baptiste [^#/(String -> int) fff]
  (let [b (fff "one")]
    b))

Generates

dc.dynamic baptiste(dc.dynamic fff$1, ){
final dc.dynamic b$1=(fff$1 as dc.int Function(dc.String, ))("one", );
return b$1;
}