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-11585] Keypath-as-function asserts in top-level code #53990

Open
airspeedswift opened this issue Oct 8, 2019 · 0 comments
Open

[SR-11585] Keypath-as-function asserts in top-level code #53990

airspeedswift opened this issue Oct 8, 2019 · 0 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 key paths Feature: key paths (both native and Objective-C)

Comments

@airspeedswift
Copy link
Member

Previous ID SR-11585
Radar rdar://problem/56055600
Original Reporter @airspeedswift
Type Bug

Attachment: Download

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

md5: e8450ec3a3722197aa362f1da612fc7b

Issue Description:

On recent toolchain, this code compiles:

func f() {
print(["hello","world"].map(.count))
}

But if you put just the print statement in a file and compile it, you get a compiler assertion:

Assertion failed: (![](getDeclContext()->isLocalContext() && "not a global variable)"), function isLazilyInitializedGlobal, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/Decl.cpp, line 5145.

@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 key paths Feature: key paths (both native and Objective-C)
Projects
None yet
Development

No branches or pull requests

2 participants