fastlane/lib/fastlane/swift_fastlane_function.rb in fastlane-2.178.0 vs fastlane/lib/fastlane/swift_fastlane_function.rb in fastlane-2.179.0
- old
+ new
@@ -114,10 +114,11 @@
return default_value
end
def get_type(param: nil, default_value: nil, optional: nil, param_type_override: nil, is_string: true)
+ require 'bigdecimal'
unless param_type_override.nil?
type = determine_type_from_override(type_override: param_type_override)
end
# defaulting type to Any if is_string is false so users are allowed to input all allowed types
@@ -166,9 +167,12 @@
# we can't handle default values for Hashes, yet
# see method swift_default_implementations for similar behavior
default_value = "[:]"
elsif type != "Bool" && type != "[String]" && type != "Int" && type != "@escaping ((String) -> Void)" && type != "Float" && type != "Double"
default_value = "\"#{default_value}\""
+ elsif type == "Float" || type == "Double"
+ require 'bigdecimal'
+ default_value = BigDecimal(default_value).to_s
end
end
# if we don't have a default value, but the param is optional, set a default value in Swift to be nil
if optional && default_value.nil?