public protocol Error: Sendable { var _domain: String { get } var _code: Int { get } // Note: _userInfo is always an NSDictionary, but we cannot use that type here // because the standard library cannot depend on Foundation. However, the // underscore implies that we control all implementations of this requirement. var _userInfo: AnyObject? { get } #if _runtime(_ObjC) func _getEmbeddedNSError() -> AnyObject? #endif }Swift.Error って空じゃないんだ・・・NSError._code じゃなくて、Error._code が隠しパラメータとして存在していてNSError is Error だから、 NSError のじゃなくて Error の _code を見ているのかも