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

NSMutableArray.remove and NSMutableOrderedSet.remove fail to remove element on Linux #4928

Open
LumingYin opened this issue Mar 27, 2024 · 0 comments

Comments

@LumingYin
Copy link

As shown in the attached screenshot, NSMutableArray.remove fails to remove the specified element on Linux. This also affects NSMutableOrderedSet.remove, which is backed by NSMutableArray.

Screenshot 2024-03-27 at 3 46 06 PM

Swift Code used to reproduce the issue:

import Foundation

let s = NSMutableArray()
s.add(2)
s.remove(2)
print(s.description)

Full Terminal output:

root@c723e86e0fc3:~# uname -a
Linux c723e86e0fc3 6.2.0-1019-azure #19~22.04.1-Ubuntu SMP Wed Jan 10 22:57:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
root@c723e86e0fc3:~# swift --version
Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-linux-gnu
root@c723e86e0fc3:~# swift repl
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lldb/__init__.py", line 1399, in <module>
    eTraceInstructionControlFlowTypeInstruction = _lldb.eTraceInstructionControlFlowTypeInstruction
AttributeError: module '_lldb' has no attribute 'eTraceInstructionControlFlowTypeInstruction'
Welcome to Swift version 5.10 (swift-5.10-RELEASE).
Type :help for assistance.
  1> import Foundation 
  2. let s = NSMutableArray() 
  3. s.add(2) 
  4. s.remove(2) 
  5. print(s.description)
(
    2
)
s: Foundation.NSMutableArray = {
  Foundation.NSArray = {
    Foundation.NSObject = {}
    _cfinfo = {
      info = 4992
      pad = 0
    }
    _storage = 1 value {
      [0] = {
        Foundation.NSValue = {
          Foundation.NSObject = {}
        }
        _base = {
          info = 5762
          pad = 0
        }
        _pad = 2
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant