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
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software generics Feature: generic declarations and types run-time crash Bug → crash: Swift code crashed during execution runtime The Swift Runtime

Comments

@swift-ci
Copy link
Collaborator

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

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

@swift-ci create

@DougGregor
Copy link
Member

Fixed by #28869

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 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 crash Bug: A crash, i.e., an abnormal termination of software generics Feature: generic declarations and types run-time crash Bug → crash: Swift code crashed during execution runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

4 participants