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-8969] @usableFromInline private(set) properties should not be mutated in @inlinable functions #51473

Closed
swift-ci opened this issue Oct 11, 2018 · 4 comments
Assignees
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-8969
Radar rdar://problem/45217648
Original Reporter koher (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Xcode Version 10.0 (10A255)

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

md5: b630f4cc490fb1ab9b70020ac8899c7e

is duplicated by:

  • SR-9308 Crash on accessing internal(set) + didSet from @inlinable function

Issue Description:

`private(set)` properties attributed by `@usableFromInline` can be mutated in `@inlinable` functions currently, in Swift 4.2.

public struct Foo {
    @usableFromInline internal private(set) var a: Int = 42
    @inlinable public mutating func f() -> Int {
        a += 1 // Should cause a compilation error
        return a
    }
}
@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Oct 12, 2018

cc @slavapestov
@swift-ci create

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 23, 2019

should be fixed by #21033

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 23, 2019

koher (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"?

Thanks!
Anna

@swift-ci
Copy link
Collaborator Author

swift-ci commented Nov 7, 2019

Comment by Yuta Koshizawa (JIRA)

Got fixed. Thanks!

@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

1 participant