carp-lang / Carp

A statically typed lisp, without a GC, for real-time applications.
Apache License 2.0
5.47k stars 173 forks source link

[bug] duplicate bindings in environment #1455

Open scolsen opened 1 year ago

scolsen commented 1 year ago

C:\Users\marti\tmp\Carp>carp examples\game_of_life.carp -x I encountered an error when emitting code:

I found an ambiguous symbol set-render-draw-color at line 52, column 8 in 'C:/Users/marti/tmp/Carp/examples/game_of_life.carp'

Possibilities: SDL.set-render-draw-color SDL.set-render-draw-color SDL.set-render-draw-color SDL.set-render-draw-color

All possibilities have the correct type.

Traceback: (build) at Compiler (Build & Run):1:5. (do (build) (run)) at Compiler (Build & Run):1:1.

hellerve commented 1 year ago

The example game_of_life.carp seems to use SDL submodules multiple times:

https://github.com/carp-lang/Carp/blob/ca5774b1aeeab2bc4d6fa901b5a55682ebc2d539/examples/game_of_life.carp#L9-L14

This seems to lead to duplicate symbols being part of the environment.

MatthewHannigan commented 1 year ago

FWIW commenting out (use SDLApp) doesn't change the behaviour at all. Same error message.