Tensegritics / Tensegritics/ClojureDart

Loose type inference on functions that are type hinted

Open
#307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
1.6k
Forks
119
PR merge metrics
No merged PRs in 30d

Description

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;
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce issue 307 with the baptiste example and compare its generated Dart output with the expected inferred types. Trace how the String -> int function type hint is handled during compilation, then verify that the generated function call and local value retain the intended types.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.