 	// MARK: [BaseMappable]
 
 	/// Returns a `[BaseMappable]` or throws an error.
-	public func value<T: BaseMappable>(_ key: String) throws -> [T] {
+	public func value<T: BaseMappable>(_ key: String, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> [T] {
 		let currentValue = self.currentValue(for: key)
 		guard let jsonArray = currentValue as? [Any] else {
-			throw MapError(key: key, currentValue: currentValue, reason: "Cannot cast to '[Any]'")
+			throw MapError(key: key, currentValue: currentValue, reason: "Cannot cast to '[Any]'", file: file, function: function, line: line)
 		}
 		return try jsonArray.enumerated().map { i, json -> T in
       return try Mapper<T>().mapOrFail(JSONObject: json)

	}

	/// Returns a `[BaseMapple]` using transform or throws an error.
	public func value<Transform: TransformType>(_ key: String, using transform: Transform) throws -> [Transform.Object] {
		let currentValue = self.currentValue(for: key)
		guard let jsonArray = currentValue as? [Any] else {
			throw MapError(key: key, currentValue: currentValue, reason: "Cannot cast to '[Any]' ")
		}
		return try jsonArray.enumerated().map { i, json -> Transform.Object in
			guard let object = transform.transformFromJSON(json) else {
				throw MapError(key: "\(key)[\(i)]", currentValue: json, reason: "Cannot transform to '\(Transform.Object.self)' using \(transform)")
			}
			return object
		}

	public var key: String?
	public var currentValue: Any?
	public var reason: String?
	public var file: StaticString?
	public var function: StaticString?
	public var line: UInt?

	init(key: String?, currentValue: Any?, reason: String?, file: StaticString? = nil, function: StaticString? = nil, line: UInt? = nil) {
		self.key = key
		self.currentValue = currentValue
		self.reason = reason
		self.file = file
		self.function = function
		self.line = line
	}
}

extension MapError: CustomStringConvertible {

	private var location: String? {
		guard let file = file, let function = function, let line = line else { return nil }
		let fileName = ((String(describing: file).components(separatedBy: "/").last ?? "").components(separatedBy: ".").first ?? "")
		return "\(fileName).\(function):\(line)"
	}

	public var description: String {
		let info: [(String, Any?)] = [
			("- reason", reason),
			("- location", location),
			("- key", key),
			("- currentValue", currentValue),
		]
		let infoString = info.map { "\($0): \($1 ?? "nil")" }.joined(separator: "\n")
		return "Got an error while mapping.\n\(infoString)"
	}

}

public protocol ImmutableMappable: BaseMappable {
