You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a very specific combination of things that I need to do to trigger this bug. I think this is the minimal code that reproduces the bug, at least anything that I remove from it fixes the issue:
require"http/server"classMyGenericHandler(T) < HTTP::Handlerdefcall(context)
call_next(context)
endendclassMyNormalHandler < HTTP::Handlerdefcall(context)
endend
my =MyNormalHandler.new
p my
server =HTTP::Server.new("0.0.0.0", "3000", [
HTTP::ErrorHandler.new,
MyGenericHandler(String).new,
my,
])
Note that I don't need to call server.listen for the issue to appear (but doing it doesn't fix it).
When I say “anything that I remove from it fixes the issue” I specifically include:
Removing the type parameter on the handler subclass
Removing the generic handler from the handlers chain
Removing the normal handler from the handlers chain
Removing the error handler from the handlers chain (other builtin handlers such as the log handler didn't cause the issue)
And, in case some of those are not weird enough, here comes the weirdest: removing the inspection of the handler instance. Note that I'm not inspecting the potentially problematic one with the type parameter, but the other one 😮
When I start the server with any of those fixes applied, it works perfectly fine. I'm on a Mac with Yosemite, in case that's relevant.
I wasn't sure whether subclassing a non-generic class adding a type parameter was supported but it seems to work fine everywhere else (and in fact here unless this specific combination of things are present).
The text was updated successfully, but these errors were encountered:
Hi, I think I hit a weird one 😁
There is a very specific combination of things that I need to do to trigger this bug. I think this is the minimal code that reproduces the bug, at least anything that I remove from it fixes the issue:
Output on current master (cf019e2):
Note that I don't need to call
server.listen
for the issue to appear (but doing it doesn't fix it).When I say “anything that I remove from it fixes the issue” I specifically include:
When I start the server with any of those fixes applied, it works perfectly fine. I'm on a Mac with Yosemite, in case that's relevant.
I wasn't sure whether subclassing a non-generic class adding a type parameter was supported but it seems to work fine everywhere else (and in fact here unless this specific combination of things are present).
The text was updated successfully, but these errors were encountered: