Skip to content

[SR-1924] locally defined class after return crashes compiler #44533

Closed
@mattneub

Description

@mattneub
Previous ID SR-1924
Radar None
Original Reporter @mattneub
Type Bug
Status Resolved
Resolution Done
Environment

Xcode Version 8.0 beta (8S128d) and its version of Swift 3

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

md5: 1a0dc260ae3d2d9a42ce72bd4313424b

Issue Description:

This code crashes the compiler with a segfault:

    func test() {
        return;
        class A {
            
        }
    }

Neither the return; nor the locally defined class A is illegal. It's the combination of the two that's the problem: defining a class locally, at any depth, after a return seems to elicit the crash.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions