-
Notifications
You must be signed in to change notification settings - Fork 50
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
Using non final class Decodable #118
Comments
I'm sorry for the inconvenience. I'm reconsidering about |
I guess we can use Himotoki/Sources/StandardLib.swift Lines 89 to 95 in a1d9dfe
And new decode function is,
static func decode(e: Extractor) throws -> Self {
let type : Int = try e <| "type"
switch type {
case 0:
return try castOrFail(B(e: e))
case 1:
return try castOrFail(C(e: e))
case 2:
return try castOrFail(A(e: e))
}
} I believe it would work well. |
okay thanks for your help! |
I'm sorry for the late response. I'm convinced that make |
I have an issue since i last updated my pods and Himotoki got upgraded to 2.0.0.
I no longer can use DecodedType and I have the following scenario I'd appreciate if you can help me fix.
I am subclassing a class which I need to be decodable like such:
I now have a compiler error on this line static func decode(e: Extractor) throws -> A which says Method 'decode' in non-final class 'A' must return 'Self' to conform to protocol 'Decodable'
Thank you for your help in advance! Great library 👍 !
The text was updated successfully, but these errors were encountered: