Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Strange error when trying to compile an #enum #290

Closed
meijeru opened this Issue · 3 comments

2 participants

@meijeru
#enum color! [a b c]
print #"^(0A)"

-= Red/System Compiler =-
Compiling tests/mytest.reds ...
*** Compilation Error: type mismatch on setting path: char/1
*** expected: [byte!]
*** found: [integer!]
*** in file: %runtime/utils.reds
*** in function: prin-byte
*** at line: 30
*** near: [
    char/1: c
    prin char
    c
]

I frankly don't understand where the prin-byte comes in during compilation?

@dockimbel
Owner

print is a variadic function that calls _print which itself calls prin-byte. Square brackets around variadic function's arguments can be omitted if there is a single argument.

@meijeru

But why does the compiler reference a path-assignment, and a function that is not even directly called from the soure?

@dockimbel
Owner

Looks like a compiler bug, probably a clash between the enumeration symbol c and the local variable c from prin-byte.

@dockimbel dockimbel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.