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
no overload matches 'Socket::Addrinfo.resolve' #10965
Comments
What was the previous version you were using? It seems the code didn't compile either before, |
it works fine with 1.0.0, I guess it was something in our code afterall. I tried to look into the changelogs/issues see if there was anything seemingly related :( |
It looks like the custom Adding proper type restrictions to the parameters should probably fix this. |
From the error trace it seems this is what's happening: Error Trace
But the custom initializer added as helper in invidious seems to override that for some reason:
EDIT: The reason is that |
I have fixed this issue, then another issue crops up, text.rindex want to return a Int32 but the number given to it was explicitly Int64. you can see the patch https://github.com/iv-org/invidious/pull/2263/files#diff-c7fb42237f52a2684edf3d22d5f0b36f7f0ac8940f71c53886fe4a294ef73357L135 I wonder why isn't these issues showing up before. did something changed in the type inferencer? or it's simply a bug got fixed. |
@tleydxdy I have created a new issue for There were some changes to the way method overloads are matched, they were supposed to be only improvements fixing incorrect behaviour. I'm not yet sure about the reason for your issue with the |
There seem to be a huge inheritance problem here. From the log provided by @straight-shoota:
So up to that part, we're good. But then:
And finally, we hit It looks like calling Correct me if my logic is wrong. Edit: sorry if that's hard to read, I tried my best at formating |
And if it happens in this case, it may probably happen in other classes. This can possibly lead to endless loops when trying to compile. |
I didn't read anything, but it's most likely a duplicate of #2293 |
See crystal-lang/crystal#10965 for more details about this issue.
@asterite Yes, that seems to be a contributing factor. But it should actually not be relevant here, because the methods have different signatures. The custom crystal/src/socket/tcp_socket.cr Lines 41 to 43 in 55ebfbf
And indeed, applying this patch to stdlib fixes the invidious build error: --- i/src/socket/tcp_socket.cr
+++ w/src/socket/tcp_socket.cr
@@ -38,8 +38,8 @@ class TCPSocket < IPSocket
super family, type, protocol
end
- protected def initialize(fd : Handle, family : Family, type : Type, protocol : Protocol)
- super fd, family, type, protocol
+ protected def initialize(fd : Handle, family : Family, type : Type, protocol : Protocol, blocking = false)
+ super fd, family, type, protocol, blocking
end
# Creates a TCPSocket from an already configured raw file descriptor The reason for this particular failure was that the |
An overrides annotation could help avoiding such issues when those inherited constructors don't override the complete super method signature (see #1647). It's a very special case, though. |
Yep, that looks very similar. Ideally, calling |
* Move Crystal stdlib classes overrides to a separate file * Document known crystal overrides * Update crystal overrides for HTTP::Client socket * Update shard.yml to restrict crystal versions * Fix compilation error in Crystal 1.1.x (See crystal-lang/crystal#10965 for more details about this issue).
When rebuilding my code with the updated crystal 1.1.0 it pops up with this error, which seems to be from the socket library itself. I'm using the debain repo from obs
The text was updated successfully, but these errors were encountered: