Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generic type 'Result' specialized with too many type parameters (got 2, but expected 1)

My code and the error

how would I solve this error and it only appears when I import Almofire.

like image 388
asdsd Avatar asked May 26 '19 22:05

asdsd


1 Answers

It's Swift.Result<T, Error>, not Swift.Result<T1, T2>. If you want to pass two values, use a tuple, i.e. Swift.Result<([Character], Data), Error> (the tuple can be auto-expanded in a switch/case handling of the result)

Also, Alamofire defines it's own Result<T> type. You should prefix it with Swift. if you want to use the Swift 5 type.

like image 71
Claus Jørgensen Avatar answered Sep 18 '22 03:09

Claus Jørgensen