We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://play.crystal-lang.org/#/r/6bxj
require "json" class Base end module Foo def to_json(val : Int32) 1 end end class Model1 < Base include Foo end class Model2 < Base include Foo end proc = ->(key : String) do if key == "1" Model1.new else Model2.new end end r = proc.call "1" pp r.to_json 8
Error in line 30: no overload matches 'Base#to_json' with type Int32 Overloads are: - Object#to_json(io : IO) - Object#to_json()
Few thing going on here.
Base
require "json"
The text was updated successfully, but these errors were encountered:
Yes, this is expected behavior. Please read this.
Sorry, something went wrong.
Oh fair enough.
No branches or pull requests
https://play.crystal-lang.org/#/r/6bxj
Few thing going on here.
Base
abstract fixes the problem.require "json"
changes the error, but should still work.The text was updated successfully, but these errors were encountered: