-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
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
Crystal 0.29.0 support #337
Comments
My understanding is that the abstract class Granite::Base
macro inherited
include JSON::Serializable
include YAML::Serializable
end
def initialize(*, __pull_for_json_serializable pull : ::JSON::PullParser)
super
end
def initialize(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : ::YAML::Nodes::Node)
super
end
end It seems I need to add this repo to test-ecosystem... |
@bcardiff I think I have it working where all the required initializers are defined on sub classes, however now I'm getting no overload matches 'Review#set_attributes' with type Hash(Symbol, YAML::Nodes::Node | YAML::ParseContext)
Overloads are:
- Review#set_attributes(args : Hash(String | Symbol, Type))
- Review#set_attributes(result : DB::ResultSet)
- Review#set_attributes(**args)
set_attributes(args.to_h) Where it seems that JSON/YAML serializable types are leaking into the has that gets created via the def initialize(**args : Object)
set_attributes(args.to_h)
end initializer. I haven't looked too much into it yet though. |
The def initialize(**args)
set_attributes(args.to_h)
end also, since there is a |
FYI granite was added to test-ecosystem crystal-lang/test-ecosystem@47a049f . It would flag issues for the next release earlier. But the stories to how to be up to date with nightlies before release needs to be improved so they can be handled in each shard. |
Even with the two initializers inside the inherited macro the specs won't run.
|
@drujensen @robacarp IMO the easiest solution here is to mark the JSON/YAML specs as pending, remove the As a workaround people could just use I currently don't have the time to do it myself, however I'd be happy to chat through it/help in the discussion if someone wants to pick it up. |
@nsuchy that means the argless initializer hidden in the concrete class. Since the last I tried moving everything inside the def initialize(*, __pull_for_json_serializable pull : ::JSON::PullParser)
super
end
def initialize(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : ::YAML::Nodes::Node)
super
end
def initialize(**args : DB::Any)
set_attributes(args.to_h)
end
def initialize(args : Hash(Symbol | String, DB::Any))
set_attributes(args)
end
def initialize
end
|
Crystal 0.29.0 support is important at the same time I won't want to see functionality go away to get that support. |
Crystal 0.29.0 is out and with breaking changes (https://github.com/crystal-lang/crystal/releases/tag/0.29.0).
@Blacksmoke16 and I discussed over Gitter DMs and we're aware of the following things that needs a fix:
The text was updated successfully, but these errors were encountered: