crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.36k stars 1.62k forks source link

Add type restriction `host : String` in `TCPSocket` and `Addrinfo` #14703

Closed straight-shoota closed 3 months ago

straight-shoota commented 3 months ago

The type of the host and domain parameter in several methods of TCPSocket and Addrinfo is effectively String. This patch adds the respective type restriction.

Other parameters could use similar restrictions, but might need more research. port/service seems to accept Int | String, for example.

Resolves #14699