Swift Intersection:Swift中的可扩展记录交集类型 源码
快捷路口 Swift中的可扩展记录/交集类型。 struct S1 { var value1: Int } struct S2 { var value2: Bool } let intersection = Intersection ( S1 ( 1 ), S2 ( true )) // Type of `intersection` works similar to `S1 & S2` (intersection type) in TypeScript), i.e.: // // struct S1_And_S2 { // var value1: Int // var value2: Bool // } XCTAssertEqual (intersection. value1 , 1 ) XCTAssertEqual (intersection. valu
用户评论