【发布时间】:2019-12-19 18:18:16
【问题描述】:
如果参数名称相同,是否可以重载方法?
def inspect(url : String); inspect_url(url) end
def inspect(path : String); inspect_path(path) end
# Always will be called with explicit names
inspect url: "some url"
inspect path: "some path"
# Never without names, this form is not needed
# and never will be used
inspect "something"
【问题讨论】:
标签: crystal-lang