freshOS / Arrow

🏹 Parse JSON with style
MIT License
387 stars 27 forks source link

Custom raw representable #25

Closed maxkonovalov closed 8 years ago

maxkonovalov commented 8 years ago

If some of your models happen to be both ArrowParsable and RawRepresentable, when trying to parse them using the <-- operator, you'll get the following error:

error: ambiguous use of operator '<--' note: found this candidate public func <--(left: inout T, right: Arrow.JSON?) note: found this candidate public func <--(left: inout T, right: Arrow.JSON?)

This issue is fixed by providing generic specialization conforming to both protocols and then parsing the model as regular ArrowParsable, as this should really be the use-case.

NOTE: the new functions implementations copy-paste the code from the corresponding custom types parsing. I think this part should be refactored before merging. @s4cha let me know what you think.

Also updated the tests and the project settings to eliminate Xcode 8.1 warnings.

s4cha commented 8 years ago

This is a great catch !