Error: no overload matches '' with type Int32

I was testing the code in the doc:

require "http/server"

server = do |context|
  context.response.content_type = "text/plain"
  context.response.print "Hello world!"

puts "Listening on"

But I got the error in the title, I looked up the method signature,
.new (port, &handler : Context -> )

What type is the port?


It should be Int32, I’m thinking this has to be a bug since the overload in the docs there isn’t displayed in the error message’s list. It’s like the constructors aren’t being seen.

There is no constructor accepting port in latest Crystal version.

You are linked to the docs for Crystal 0.23.1


1 Like

Where are these docs that you mention?

Oo yea good call, didn’t notice it was a link to older docs

Sorry Sirs, I just clicked a doc link in google results, sorry.

Yes, unfortunately documentation for outdated versions keeps showing up high in search results. We’re working on that in