Skip to content

Reassigning unit values emits broken C #1542

Description

@hellerve

We emit broken C when we re-assign a unit variable (should be a no-op):

鲤 (defn main [] (let [x ()] (set! x ())))
鲤 :bx
out/main.c:11335:9: error: use of undeclared identifier 'x'
 11335 |         x = ;  // () = ()
       |         ^
out/main.c:11335:13: error: expected expression
 11335 |         x = ;  // () = ()
       |             ^
2 errors generated.
carp: callCommand: clang  -o out/Untitled -I /Users/veitheller/Documents/Code/Github/carp/Carp//core/  -fPIC -g -std=c99 -D_DEFAULT_SOURCE -Wall -Werror -Wno-unknown-warning-option -Wno-unused-variable -Wno-unused-but-set-variable -Wno-self-assign -lm out/main.c (exit 1): failed

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions