Tensegritics / Tensegritics/ClojureDart

compiler.cljc : `is-assignable` returns true for Function when it should not

Open
#166 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

to reproduce:

(binding [analyzer-info li
            *dart-out* *out*
            *locals-gen* {}]
    (is-assignable?      
      (emit-type '^{:params-types (String)} dart:core/Function {})
      (emit-type '^{:params-types (int)} dart:core/Function {})))

It has impact in many places of the code but I discovered it when trying a (dart/is? f #/(-> int)) that should return false

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

Start in compiler.cljc at is-assignable? and run the provided binding and emit-type reproduction. Trace how Function types with different parameter types are compared, then verify that the incompatible String and int signatures are not considered assignable and that the reported dart/is? case returns false.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.