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-7423] Unexpected error: "setter for 'lines' is unavailable" on using subscript of array property that has setter marked as @available(*, unavailable) #49966

Open
norio-nomura opened this issue Apr 13, 2018 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@norio-nomura
Copy link
Contributor

Previous ID SR-7423
Radar None
Original Reporter @norio-nomura
Type Bug
Environment

swift-DEVELOPMENT-SNAPSHOT-2018-04-12-a

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

md5: ed09b43b9671c33901747449c553f7cd

relates to:

  • SR-7335 Mutating struct when accessing read only member through subscript

Issue Description:

$ xcrun --toolchain org.swift.4220180412a swift
Welcome to Apple Swift version 4.2-dev (LLVM 064f71a292, Clang 6c6785601f, Swift ab9f62dcd8). Type :help for assistance.
  1> class File { 
  2.     var lines: [String] { 
  3.         get { 
  4.             return ["1"] 
  5.         } 
  6.         @available(*, unavailable) set {} 
  7.     } 
  8. } 
  9.  
 10. var file = File() 
 11. print(file.lines[0])
error: repl.swift:11:7: error: setter for 'lines' is unavailable
print(file.lines[0])
      ^~~~~~~~~~

repl.swift:6:36: note: setter for 'lines' has been explicitly marked unavailable here
        @available(*, unavailable) set {}
         ~~~~~~~~~~~~~~~~~~~~~~~~~ ^
@norio-nomura
Copy link
Contributor Author

cc @belkadan

@belkadan
Copy link
Contributor

Hm, I guess I broke something. Thanks!

@belkadan
Copy link
Contributor

Hm, this one isn't me. There's an extra inout in the AST that shouldn't be there, a lot like SR-7335.

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

No branches or pull requests

2 participants