Skip to content
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

invalid instruction when referencing overridden private interface types #14467

Open
Blacksmoke16 opened this issue Apr 9, 2024 · 0 comments
Open

Comments

@Blacksmoke16
Copy link
Member

# test2.cr
module OtherInterface; end

private record One do
  include OtherInterface
end

private record Two do
  include OtherInterface
end

([One.new, Two.new] of OtherInterface) == [One.new, Two.new]

Then:

# test.cr
require "./test2"

module OtherInterface; end

private record One do
  include OtherInterface
end

private record Two do
  include OtherInterface
end

pp [One.new, Two.new] == [One.new, Two.new]

Results in:

$ crystal test.cr
Program exited because of an invalid instruction

If I had to guess, I'd say something regarding the "private to the file" thing isn't working out exactly as we expect giving one or the other files a reference to the other?

Originally posted by @Blacksmoke16 in #14447 (comment)

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

No branches or pull requests

1 participant