0001    //
0002    //  StandardLib.swift
0003    //  Himotoki
0004    //
0005    //  Created by Syo Ikeda on 11/18/15.
0006    //  Copyright © 2015 Syo Ikeda. All rights reserved.
0007    //
0008    
0009    extension String: Decodable {
0010        public static func decode(e: Extractor) throws -> String {
0011            return try castOrFail(e)
0012        }
0013    }
0014    
0015    extension Int: Decodable {
0016        public static func decode(e: Extractor) throws -> Int {
0017            return try castOrFail(e)
0018        }
0019    }
0020    
0021    extension Double: Decodable {
0022        public static func decode(e: Extractor) throws -> Double {
0023            return try castOrFail(e)
0024        }
0025    }
0026    
0027    extension Float: Decodable {
0028        public static func decode(e: Extractor) throws -> Float {
0029            return try castOrFail(e)
0030        }
0031    }
0032    
0033    extension Bool: Decodable {
0034        public static func decode(e: Extractor) throws -> Bool {
0035            return try castOrFail(e)
0036        }
0037    }
0038    
0039    internal func castOrFail
NSNumber.swift:13
        return try castOrFail(e)
StandardLib.swift:11
        return try castOrFail(e)
StandardLib.swift:17
        return try castOrFail(e)
StandardLib.swift:23
        return try castOrFail(e)
StandardLib.swift:29
        return try castOrFail(e)
StandardLib.swift:35
        return try castOrFail(e)
<T>(e: Extractor) throws -> T { 0040 let rawValue = e.rawValue 0041 0042 guard let result = rawValue as? T else { 0043 throw typeMismatch("\(T.self)", actual: rawValue, keyPath: nil) 0044 } 0045 0046 return result 0047 } 0048