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-3388] Compiler crash (generics) #45976

Closed
swift-ci opened this issue Dec 10, 2016 · 2 comments
Closed

[SR-3388] Compiler crash (generics) #45976

swift-ci opened this issue Dec 10, 2016 · 2 comments
Assignees
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

Previous ID SR-3388
Radar rdar://20470738
Original Reporter maniacus_gd (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @slavapestov
Priority Medium

md5: 9d04b7a69fe1f33fbdf2732641dd4fd8

is duplicated by:

  • SR-1980 Emit multiple vtable entries for overrides that change calling convention

Issue Description:

This code below, crashes compiler. Maybe the 'override' keyword shouldn't be accepted in the Derived class in this case?

class Base<T> {
    func test() -> T? {
        fatalError()
    }
}

class Derived<T>: Base<T> {
    override func test() -> T {
        fatalError()
    }
}

_ = Derived<String>().test()
0  swift                    0x000000010e1873bd PrintStackTraceSignalHandler(void*) + 45
1  swift                    0x000000010e186b66 SignalHandler(int) + 790
2  libsystem_platform.dylib 0x00007fffcaffbbba _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000001 _sigtramp + 889209953
4  swift                    0x000000010e005ad1 (anonymous namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&) + 1649
5  swift                    0x000000010dfbc8ad llvm::FPPassManager::runOnFunction(llvm::Function&) + 973
6  swift                    0x000000010dfc4399 llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 473
7  swift                    0x000000010b2e106b performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef) + 4507
8  swift                    0x000000010b2df5b1 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 2625
9  swift                    0x000000010b194d41 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 23745
10 swift                    0x000000010b18d0e3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 17859
11 swift                    0x000000010b1493ef main + 8239
12 libdyld.dylib            0x00007fffcadee255 start + 1
13 libdyld.dylib            0x0000000000000047 start + 891362803
Stack dump:

Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9

@belkadan
Copy link
Contributor

@slavapestov, we've seen this before, right?

@slavapestov
Copy link
Member

This works if 'T' is class-constrained, but not in the general case. It is something we plan on supporting eventually.

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

No branches or pull requests

4 participants