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-7443] Infinite Compilation When Referencing Inner Type #49986

Open
swift-ci opened this issue Apr 16, 2018 · 2 comments
Open

[SR-7443] Infinite Compilation When Referencing Inner Type #49986

swift-ci opened this issue Apr 16, 2018 · 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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 16, 2018

Previous ID SR-7443
Radar None
Original Reporter charlieMonroe (JIRA User)
Type Bug

Attachment: Download

Environment

macOS 10.13.4, Xcode 9.3 with default and Apr 15, 2018 (master) toolchains.

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

md5: 5f0d9a1c31aa90a97efa94caa7178d10

Issue Description:

Please, see the following example:

@objc(TTCategoryBase)
class TTCategoryBase: NSManagedObject {
    /// Backing of the category type.
    @NSManaged fileprivate var categoryTypeRaw: String
}

/// Category middle-class with generics.
class TTCategory<T: RawRepresentable>: TTCategoryBase where T.RawValue == String {
    /// Category type.
    var categoryType: T {
        return T.init(rawValue: self.categoryTypeRaw)!
    }
}

@objc(TTMessageCategory)
final class TTMessageCategory: TTCategory<TTMessageCategory.CategoryType> {
    enum CategoryType: String {
        case news
        case programmeChanges = "programme_changes"
    }
}

Additionally, with the master April 15, 2018 build, SourceKit crashes with Assertion failed: (isSatisfied(request)) (attached).

@belkadan
Copy link
Contributor

Same assertion failure with a near-master compiler:

1.  While type-checking 'TTMessageCategory' at <stdin>:16:7
2.  While validating 'TTMessageCategory' at <stdin>:16:7
3.  While resolving type TTCategory<TTMessageCategory.CategoryType> at [<stdin>:16:32 - line:16:73] RangeText="TTCategory<TTMessageCategory.CategoryType>"
4.  While resolving type TTMessageCategory.CategoryType at [<stdin>:16:43 - line:16:61] RangeText="TTMessageCategory.C"
5.  While validating 'CategoryType' at <stdin>:17:2

I'm pretty sure we have a dup of this. @DougGregor, @xedin?

@belkadan
Copy link
Contributor

Note that I get this even without importing Foundation or CoreData; it's happening very early.

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

No branches or pull requests

3 participants