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-11332] "expected a class here" failed. #53733

Open
swift-ci opened this issue Aug 20, 2019 · 4 comments
Open

[SR-11332] "expected a class here" failed. #53733

swift-ci opened this issue Aug 20, 2019 · 4 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 Linux Platform: Linux

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11332
Radar rdar://problem/54514552
Original Reporter MrLotU (JIRA User)
Type Bug

Attachment: Download

Environment

Docker swift:latest

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

md5: 7f587521c2860051af3bf147be891834

Issue Description:

When building my project (repro at https://github.com/MrLotU/bug-repros/tree/ExpectedAClassHere), everything works fine on MacOS but I get a bunch of errors on Linux (docker swift:latest).

Error:

swift: /home/buildnode/jenkins/workspace/oss-swift-5.0-package-linux-ubuntu-18_04/swift/lib/AST/Type.cpp:3096: swift::Type swift::TypeBase::getSuperclassForDecl(const swift::ClassDecl *, bool): Assertion `isa<ClassDecl>(nominalDecl) && "expected a class here"' failed.
@gwynne
Copy link
Contributor

gwynne commented Aug 20, 2019

Full repro steps:

$ docker run -ti swift:latest
# swift --version
Swift version 5.0.2 (swift-5.0.2-RELEASE)
# apt update && apt install libssl-dev zlib1g-dev
# git clone --branch ExpectedAClassHere https://github.com/MrLotU/bug-repros && cd bug-repros
# swift build

Full output from build attached, key excerpts:

swift: /home/buildnode/jenkins/workspace/oss-swift-5.0-package-linux-ubuntu-18_04/swift/lib/AST/Type.cpp:3096: swift::Type swift::TypeBase::getSuperclassForDecl(const swift::ClassDecl *, bool): Assertion `isa<ClassDecl>(nominalDecl) && "expected a class here"' failed.
2.  While silgen emitFunction SIL function "@$s3App14TodoControllerC5indexy3NIO15EventLoopFutureCySayAA0B0CGG5Vapor7RequestCKF".
 for 'index(_:)' (at /bug-repros/Sources/App/Controllers/TodoController.swift:6:5)

Also confirmed it fails to repro on macOS (Apple Swift version 5.1 (swiftlang-1100.0.270.6 clang-1100.0.32.1)).

@belkadan
Copy link
Contributor

That is from 5.0, so it's possible it's been fixed in 5.1.

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Jari Koopman (JIRA)

I will give it a shot on a Swift 5.1 Docker image too to check if that's the case.

@belkadan
Copy link
Contributor

Requires OpenSSL / LibreSSL if building on Mac, so I can't verify that at the moment.

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

No branches or pull requests

4 participants