Skip to content

DecodedType is removable at Swift 2.1 #97

@tarunon

Description

@tarunon

Swift2.1 function is returnable Self type in class, so I think we don't need DecodedType now.

public protocol Decodable {
    /// - Throws: DecodeError
    static func decode(e: Extractor) throws -> Self
}

That is destructive change, but it has some advantages.

  1. as Decodable.
    Now we cannot cast any value to Decodable because it has associated type.
    If it remove Decodable, we will able to do it.
  2. Support subclass.(restrict)
    Himotoki don't support subclass now, because DecodedType bounds base class.
    But swift don't support override extensions function, the merit will be restrict.
  3. Integration operators.(Array, Dictionary, Optional.)
    If you aspect runtime check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions