Tensegritics / Tensegritics/ClojureDart

Type hinting a function with `void` crashes the ClojureDart compiler

Open
#384 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

Functions type hinted with void cause the ClojureDart compiler to crash.

Version

ClojureDart release tag: 0.9.20260822a

Example
(defn hi ^void []
  (prn "hi"))

;; hint location makes no difference
;; (defn ^void hello []
;;  (prn "hello"))
Result
clj -M:cljd compile
Compiling to Dart... @11:49:33
  example.main
Execution error (AssertionError) at cljd.compiler/relocatable-class-name (compiler.cljc:3276).
Assert failed: oh noes void{:kind :class, :element-name "void", :canon-qname void, :qname void, :type-parameters [], :nullable false}
(qualified-symbol? relocatable-type)
Expected
clj -M:cljd compile
Compiling to Dart... @12:07:05
  example.main
Compilation succeeded - I like when a plan comes together! 👨‍🦳 @12:07:13

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 the crash with the provided Clojure example using clj -M:cljd compile, then start at compiler.cljc:3276 in cljd.compiler/relocatable-class-name. Trace how the void type hint is represented and confirm that compilation succeeds for the example without the assertion failure.

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
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.