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-2854] Compiler crash when mutating collection contained by objc protocol #45448

Open
swift-ci opened this issue Oct 4, 2016 · 3 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 SILGen Area → compiler: The SIL generation stage

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 4, 2016

Previous ID SR-2854
Radar None
Original Reporter spf2 (JIRA User)
Type Bug
Environment

swift 3

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

md5: 923c53d696c0ec1f6beaa46768de7064

Issue Description:

Compiler crash is triggered by this code: https://gist.github.com/spf2/ed198c4e80a03cefbb23fe936338bf10

If you get rid of the @objc annotation, the compiler gives: error: MyPlayground.playground:8:13: error: cannot use mutating member on immutable value: 'foo' is a 'let' constant.

By the way, compiler also crashes with this code: https://gist.github.com/spf2/df1e381d00527e45df1b9b94325d4530 even though it compiles fine if you remove the @objc annotation.

@belkadan
Copy link
Contributor

belkadan commented Oct 5, 2016

Assertion failed: (decl->getMaterializeForSetFunc() && "polymorphic storage without materializeForSet"), function getMaterialized, file /Volumes/Data/swift-public/swift/lib/SILGen/SILGenLValue.cpp, line 852.

@belkadan
Copy link
Contributor

belkadan commented Oct 5, 2016

ObjC protocols aren't going to have materializeForSet decls, so SILGen can't rely on this.

@belkadan
Copy link
Contributor

belkadan commented Oct 5, 2016

cc @jckarter, @slavapestov (when he gets back)

@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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants