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
SR-2549 [CRTP] Non-generic class inheriting from a generic class with Self as generic parameter locks execution
Issue Description:
Even in one source file (i.e. not across compilation boundaries,) inheriting from a generic and using the derived class as a generic parameter results in a runtime crash. See included test case. This looks like a contrived example but comes up in frameworks code where the generic needs to know the type of the final class for type safety.
importXCTest// swiftlint:disable private_over_fileprivatefileprivateclassG<T> {
funcfoo(test: T) {
print("\(test)")
}
}
fileprivateclassC: G<C> {
}
classTestSwiftSR6469: XCTestCase {
functestSelfReferentialGeneric() {
// this test breaks with locking loop at runtime_ = C()
}
}
The text was updated successfully, but these errors were encountered:
Environment
swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-23-a.xctoolchain
also happens in XCode 9.1 as shipped by Apple
Additional Detail from JIRA
md5: 43720e4e0d59a2a27c29bbd196f287e2
duplicates:
Issue Description:
Even in one source file (i.e. not across compilation boundaries,) inheriting from a generic and using the derived class as a generic parameter results in a runtime crash. See included test case. This looks like a contrived example but comes up in frameworks code where the generic needs to know the type of the final class for type safety.
The text was updated successfully, but these errors were encountered: