You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Example ImmutableStructExample=ImmutableStruct.new([:name])Example.new(name: "somestring")# => NoMethodError (undefined method `to_a' for "somestring":String)
Potential solution:
Check if we can call #to_a on the object that we are receiving. If we cannot, continue to fail but provide a more helpful message around what failed and how to fix it. Proposed language:
Expected Array for property: :name, Got: String
This one maintains the current API and behavior.
Alternative solution
Instead of using Object#to_a use Array(Object) which will wrap the object in an array or no-op if it's already an array.
The text was updated successfully, but these errors were encountered:
Problem
Potential solution:
Check if we can call
#to_a
on the object that we are receiving. If we cannot, continue to fail but provide a more helpful message around what failed and how to fix it. Proposed language:Expected Array for property: :name, Got: String
This one maintains the current API and behavior.
Alternative solution
Instead of using
Object#to_a
useArray(Object)
which will wrap the object in an array or no-op if it's already an array.The text was updated successfully, but these errors were encountered: