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-5503] Compiler crash with nested function with default argument #48075

Closed
swift-ci opened this issue Jul 19, 2017 · 2 comments
Closed

[SR-5503] Compiler crash with nested function with default argument #48075

swift-ci opened this issue Jul 19, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5503
Radar None
Original Reporter mike@there4iam.xyz (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment
$ swiftc --version
Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 3bb408fc1b179d1d91e75ccd8e413fbe

duplicates:

  • SR-2189 Nested function with local default value crashes

Issue Description:

Following code :

import Foundation

func topLevel()
{
    let red  = "red",
        blue = "blue"
    
    func nested(tint: String = red)
    {
        
    }
    
    nested()
}

makes compiler crash :

$ swiftc Repro.swift 
Global is external, but doesn't have external or weak linkage!
i8* ()* @_TFF5Repro8topLevelFT_T_auL_3redSS
LLVM ERROR: Broken module found, compilation aborted!
@swift-ci
Copy link
Collaborator Author

Comment by Mike (JIRA)

not 100% sure it is the same thing because of the different error message...

@belkadan
Copy link
Contributor

Yeah, it's the same. Yours is from a compiler with assertions turned off.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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
Projects
None yet
Development

No branches or pull requests

2 participants