mirror of
https://github.com/zhigang1992/Argo.git
synced 2026-01-12 22:45:56 +08:00
Introducing this typealias helps when trying to conform a non-final class to `JSONDecodable`. If we just use `Self`, we run into an issue where the compiler can't ensure that return type is correct, because the class might be subclassed. By letting classes explicitly define their decoded type, we can make the compiler happy while maintaining the ability to subclass if that's what we want. As an added benefit, we can default `DecodedType` to `Self`, which means that `structs` and `final` classes don't need to worry about changing anything from the way they are doing it now.
4 lines
35 B
JSON
4 lines
35 B
JSON
{
|
|
"url": "http://example.com",
|
|
}
|