Skip to content

case returning strings #995

Description

@cjbarre

case returning strings

Commit Date Change
Last working 7b29eef2a July 22, 2026
First broken 12637c9e0 July 25, 2026 Switch to native literals by default

case_string.jank:

(ns case-string)

(defn choose [x]
  (case x :a "A" :b "B" "default"))

(defn -main [& _]
  (assert (= ["A" "B" "default"] (mapv choose [:a :b :other])))
  (println :pass))
Commit Result
Before 7b29eef2a run-main and the compiled executable print :pass and exit 0.
After 12637c9e0 run-main and compile exit 1: error: no viable overloaded '='.

The generated code tries to assign a C++ string pointer to a jank object reference.


Slack

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions