Skip to content

Commit 39c47d0

Browse files
committed
Merge branch 'main' of github.com:swiftwasm/swift-corelibs-foundation into swiftwasm
# Conflicts: # Sources/Foundation/NSSet.swift
2 parents 3e5dbcc + 82b8fa2 commit 39c47d0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Sources/Foundation/NSSet.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ open class NSSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCodi
8686
self.init(array: [object])
8787
}
8888

89+
public convenience init(objects elements: Any...) {
90+
self.init(array: elements)
91+
}
92+
8993
#if !os(WASI)
9094
internal class func _objects(from aDecoder: NSCoder, allowDecodingNonindexedArrayKey: Bool = true) -> [NSObject] {
9195
guard aDecoder.allowsKeyedCoding else {

Tests/Foundation/Tests/TestNSSet.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class TestNSSet : XCTestCase {
2626
XCTAssertEqual(set5, set3)
2727
set5.add(2)
2828
XCTAssertNotEqual(set5, set3)
29+
30+
let set6 = NSSet(objects: "foo", "bar")
31+
XCTAssertEqual(set6.count, 2)
32+
XCTAssertEqual(set2, set6)
2933
}
3034

3135
func testInitWithSet() {

0 commit comments

Comments
 (0)