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

IO::Error no parameter named 'cause' #14241

Closed
jwoertink opened this issue Jan 15, 2024 · 2 comments · Fixed by #14242
Closed

IO::Error no parameter named 'cause' #14241

jwoertink opened this issue Jan 15, 2024 · 2 comments · Fixed by #14242
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:regression Something that used to correctly work but no longer works topic:stdlib:files
Milestone

Comments

@jwoertink
Copy link
Contributor

Maybe a regression? This compiles fine in Crystal 1.10.1, but fails to compile in Crystal 1.11.1

error = Exception.new("oops")
IO::Error.new("parsing proxy initialization", cause: error)
In lib/connect-proxy/src/connect-proxy.cr:134:23

 134 | raise IO::Error.new("parsing proxy initialization", cause: error)
                       ^--
Error: no parameter named 'cause'

Overloads are:
 - IO::Error.new(message : String | ::Nil = nil, *, target = nil)

I opened an issue here spider-gazelle/connect-proxy#4

@jwoertink jwoertink added the kind:bug A bug in the code. Does not apply to documentation, specs, etc. label Jan 15, 2024
@straight-shoota
Copy link
Member

Yeah, this is caused by #13865 which introduces a new def IO::Error#initialize. This removes all inherited #initialize defs from IO::Error, which means the implementation from Exception with cause parameter isn't available anymore.

@straight-shoota straight-shoota added topic:stdlib:files kind:regression Something that used to correctly work but no longer works labels Jan 15, 2024
@straight-shoota straight-shoota added this to the 1.11.2 milestone Jan 15, 2024
@straight-shoota
Copy link
Member

Resolved by #14242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:regression Something that used to correctly work but no longer works topic:stdlib:files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants