Skip to content

Commit 34f81fc

Browse files
committed
81014: Swift: cannot use [T] as Sequence
1 parent 66dc9cb commit 34f81fc

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Source/Array.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,11 @@ public extension Swift.Array : ISequence<T> {
714714
#endif
715715

716716
#if ISLAND
717+
@Implements(typeOf(IEnumerable), "GetEnumerator")
718+
func GetEnumeratorNG() -> IEnumerator! {
719+
return list.GetEnumerator()
720+
}
721+
717722
public func GetEnumerator() -> IEnumerator<T>! {
718723
return list.GetEnumerator()
719724
}

Source/Dictionary.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,16 @@ public extension Swift.Dictionary : ISequence<(Key,Value)> {
374374
#endif
375375

376376
#if ISLAND
377-
func GetEnumerator() -> IEnumerator<(Key,Value)>! {
377+
378+
func GetEnumerator() -> IEnumerator! {
379+
for entry in dictionary {
380+
var item: (Key, Value) = (entry.Key, entry.Value)
381+
__yield item
382+
}
383+
}
384+
385+
@Implements(typeOf(IEnumerable<(Key,Value)>), "GetEnumerator")
386+
func GetEnumeratorT() -> IEnumerator<(Key,Value)>! {
378387
for entry in dictionary {
379388
var item: (Key, Value) = (entry.Key, entry.Value)
380389
__yield item

Source/Set.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,12 @@ public extension Swift.Set : ISequence<T> {
506506
#endif
507507

508508
#if ISLAND
509-
func GetEnumerator() -> IEnumerator<T>! {
509+
@Implements(typeOf(IEnumerable), "GetEnumerator")
510+
func GetEnumeratorNG() -> IEnumerator! {
511+
return _set.GetEnumerator()
512+
}
513+
514+
public func GetEnumerator() -> IEnumerator<T>! {
510515
return _set.GetEnumerator()
511516
}
512517
#endif

0 commit comments

Comments
 (0)