Skip to content
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

Overflow prepare stdlib #7256

Merged
Merged
4 changes: 2 additions & 2 deletions src/yaml/from_yaml.cr
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end

{% for type in %w(Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64) %}
def {{type.id}}.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
{{type.id}}.new parse_scalar(ctx, node, Int64)
{{type.id}}.new! parse_scalar(ctx, node, Int64)
end
{% end %}

Expand All @@ -57,7 +57,7 @@ def String.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
end

def Float32.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
parse_scalar(ctx, node, Float64).to_f32
parse_scalar(ctx, node, Float64).to_f32!
end

def Float64.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Expand Down