Closed 0oneo closed 2 years ago
I make the following change then run swift test
, everything runs ok
public protocol DefaultsBaseKey {
var name: String { get }
var suite: UserDefaults { get }
}
Test Suite 'DefaultsTests' passed at 2021-11-20 18:59:52.656.
Executed 35 tests, with 0 failures (0 unexpected) in 0.946 (0.947) seconds
Test Suite 'DefaultsPackageTests.xctest' passed at 2021-11-20 18:59:52.656.
Executed 360 tests, with 0 failures (0 unexpected) in 2.094 (2.110) seconds
Test Suite 'All tests' passed at 2021-11-20 18:59:52.656.
Executed 360 tests, with 0 failures (0 unexpected) in 2.094 (2.112) seconds
I am reading the source code, and it makes me confused, here is the details of my question:
protocol
DefaultsBaseKey
extendsDefaults.AnyKey
,Defaults.AnyKey
is a typealias forDefaults.Keys
, classDefaults.Keys
implements protocolDefaults.BaseKey
, protocolDefaults.BaseKey
is typealias forDefaultsBaseKey
. it's a loop, and this loop is strange to me