【文件属性】:
文件名称:Swift-Intersection:Swift中的可扩展记录交集类型
文件大小:6KB
文件格式:ZIP
更新时间:2021-03-08 12:44:41
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
【文件预览】:
Swift-Intersection-main
----Sources()
--------Intersection()
----Tests()
--------IntersectionTests()
--------LinuxMain.swift(126B)
----LICENSE(1KB)
----README.md(525B)
----Package.swift(1KB)
----.gitignore(2KB)