You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
Votes
2
Component/s
Labels
Bug
Assignee
None
Priority
Medium
md5: 2c0cd9cf0b0ddbc83e4a2b1d8bf276b4
Issue Description:
importFoundation// Make 5 pattern base typesclassA {}
protocolB {}
protocolC: class {}
@objcprotocolD {}
protocolE: NSObjectProtocol {}
// Make container protocolprotocolContainer {
associatedtypeWrapped
}
// If Container conforms to Wrapped then return true.functypeCheckShouldBeSuccess<T: Container>(_type: T.Type) -> Bool {
returnT.selfisT.Wrapped.Type
}
// Always false because T.self is type and not conforms to value of Wrapped.functypeCheckShouldBeFailure<T: Container>(_type: T.Type) -> Bool {
returnT.selfisT.Wrapped
}
// Make Container implementation that extends of base type, and Wrapped is base type.classContainerA: A, Container {
typealiasWrapped = A
}
classContainerB: B, Container {
typealiasWrapped = B
}
classContainerC: C, Container {
typealiasWrapped = C
}
classContainerD: D, Container {
typealiasWrapped = D
}
classContainerE: NSObject, E, Container {
typealiasWrapped = E
}
// Case of A is fine.letr01 = ContainerA.selfisContainerA.Wrapped.Type// true. ContainerA is subclass of Aletr02 = typeCheckShouldBeSuccess(ContainerA.self) // true. Should be same of r01letr03 = ContainerA.selfisContainerA.Wrapped// false. ContainerA.self is Type, not value of A.letr04 = typeCheckShouldBeFailure(ContainerA.self) // false. Should be same of r03// Cases of B~E are (maybe) wrong.letr05 = ContainerB.selfisContainerB.Wrapped.Type// true. ok.letr06 = typeCheckShouldBeSuccess(ContainerB.self) // false. wrong. It should be same of r05.letr07 = ContainerB.selfisContainerB.Wrapped// false. ok.letr08 = typeCheckShouldBeFailure(ContainerB.self) // false. ok.letr09 = ContainerC.selfisContainerC.Wrapped.Type// true. ok.letr10 = typeCheckShouldBeSuccess(ContainerC.self) // false. wrong. It should be same of r09.letr11 = ContainerC.selfisContainerC.Wrapped// false. ok.letr12 = typeCheckShouldBeFailure(ContainerC.self) // true. wrong. It should be same of r11.letr13 = ContainerD.selfisContainerD.Wrapped.Type// true. ok.letr14 = typeCheckShouldBeSuccess(ContainerD.self) // false. wrong. It should be same of r13.letr15 = ContainerD.selfisContainerD.Wrapped// true. wrong. ContainerD.self is Type, not value of D.letr16 = typeCheckShouldBeFailure(ContainerD.self) // true. wrong. letr17 = ContainerE.selfisContainerE.Wrapped.Type// true. ok.letr18 = typeCheckShouldBeSuccess(ContainerE.self) // false. wrong. It should be same of r17.letr19 = ContainerE.selfisContainerE.Wrapped// false. ok.letr20 = typeCheckShouldBeFailure(ContainerE.self) // true. wrong. It should be same of r19.
The text was updated successfully, but these errors were encountered:
Environment
Xcode
Version 9.1 (9B55)
Swift
Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: 2c0cd9cf0b0ddbc83e4a2b1d8bf276b4
Issue Description:
The text was updated successfully, but these errors were encountered: