Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-10101] Type 'T' does not conform to protocol ( Command failed due to signal: Segmentation fault: 11) #52503

Closed
swift-ci opened this issue Mar 13, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-10101
Radar None
Original Reporter spiceginger (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Swift 4.2, Xcode 10.2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: 18b29eca8c50402a24d557a6379b4070

Issue Description:

Compiler complains: Type 'T' does not conform to protocol 'Test'. On a bigger projects compiler may crash with: Command failed due to signal: Segmentation fault: 11

protocol Test {
    
    func test()
    
}

//protocol SuperTest: Test { Works Fine
protocol SuperTest where Self: Test {
    
    func superTest()
    
}

struct Tester: Test, SuperTest {

    func test() {
        print("test")
    }
    
    func superTest() {
        test()
    }
    
}

struct TesterWrapper<T: Test>: Test {
    
    let tester: T
    
    init(tester: T) {
        self.tester = tester
    }
    
    func test() {
        tester.test()
    }

}

extension TesterWrapper: SuperTest where T: SuperTest {
    
    func superTest() {
        tester.superTest() // <- Type 'T' does not conform to protocol 'Test'
    }
    
}
@belkadan
Copy link
Contributor

Fixed in Swift 5!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants