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-11642] Runtime crash demangling associated type for type defined in equality-constrained extension #54052

Closed
swift-ci opened this issue Oct 20, 2019 · 2 comments

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Oct 20, 2019

Previous ID SR-11642
Radar rdar://problem/56466693
Original Reporter siemensikkema (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS Catalina

MacBook Pro (15-inch, 2017)

Xcode 11 Version 11.1 (11A1027)

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, Generics, RunTimeCrash, Runtime
Assignee None
Priority Medium

md5: 5e3272992c6dde352a1ca1e2e8d25287

Issue Description:

I found a runtime crash when running the following code (e.g. in a playground):

// MARK: Types


struct Validator<T> {
    let validatorFailureType: Any.Type
}


protocol ValidatorType {
    associatedtype Data
    associatedtype Failure
    func validator() -> Validator<Data>
}


extension ValidatorType {
    func validator() -> Validator<Data> {
        .init(validatorFailureType: Failure.self)
    }
}


// MARK: Failing example


extension Validator where T == String {
    struct V: ValidatorType {
        typealias Data = T // or String
        struct Failure {}
    }
}


Validator.V().validator() // failed to demangle witness for associated type 'Failure' in conformance '(extension in __lldb_expr_1):__lldb_expr_1.Validator<Swift.String>.V4: ValidatorType' from mangled name '13__lldb_expr_19ValidatorVAASSRszrlE2V4V7FailureVyx__G'

I attached a playground file that contains a few similar but non-crashing examples.

@belkadan
Copy link
Contributor

@belkadan belkadan commented Oct 21, 2019

Looks similar to some of the other same-type-constraint issues we've seen…

@swift-ci create

@DougGregor
Copy link
Member

@DougGregor DougGregor commented Dec 19, 2019

Fixed by #28869

@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
Projects
None yet
Development

No branches or pull requests

3 participants