-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crystal 1.15 seems to have symbol Index
reserved
#15357
Comments
This is a regression from refactoring the internal The fix is simple, adjust the path to point to But I'm wondering if we shouldn't have caught this issue with a compiler error (or warning). (see #15359) |
Yea I'm surprised this didn't originally error due to an "Undefined constant" or something. |
alias Index = Int32 # (un-)comment to trigger error
# src/crystal/event_loop/polling/arena.cr
class Crystal::EventLoop::Polling::Arena(T, BLOCK_BYTESIZE)
# ...
struct Index
# ...
end
end
# src/crystal/event_loop.cr
abstract class Crystal::EventLoop
# ...
end
# src/crystal/event_loop/polling.cr
abstract class Crystal::EventLoop::Polling < Crystal::EventLoop
# ...
protected abstract def system_add(fd : Int32, index : Index) : Nil
# ...
end |
The abstract method refers to the non existing `Index` type. Weirdly the compiler won't complain until someone defines an `Index` type. Resolves #15357 (cherry picked from commit 5a245d9) Co-authored-by: Johannes Müller <[email protected]>
With
Crystal 1.15.0 [7b9e2ef80] (2025-01-09), LLVM: 18.1.6, Default target: x86_64-unknown-linux-gnu
running the following ...... I get...
However, there was no issue on prior releases, e.g. 1.14: https://play.crystal-lang.org/#/r/hm4t
The text was updated successfully, but these errors were encountered: