Skip to content

Commit

Permalink
workaround failed associated type inference (apple#1299)
Browse files Browse the repository at this point in the history
Motivation:

Some Swift nightly snapshots fail to compile NIO in release mode
(rdar://57793267), this change is to work around this issue by telling
them compiler the associatedtypes explicitly.

Modifications:

- add `Element` and `Indices` typealises to `CircularBuffer` explicitly.

Result:

Complies on all nightlies also in release mode.
  • Loading branch information
weissi authored and Lukasa committed Dec 10, 2019
1 parent e0757ea commit 3f04a5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/NIO/CircularBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public struct CircularBuffer<Element>: CustomStringConvertible {

// MARK: Collection/MutableCollection implementation
extension CircularBuffer: Collection, MutableCollection {
public typealias Element = Element
public typealias Indices = DefaultIndices<CircularBuffer<Element>>
public typealias RangeType<Bound> = Range<Bound> where Bound: Strideable, Bound.Stride: SignedInteger
public typealias SubSequence = CircularBuffer<Element>

Expand Down

0 comments on commit 3f04a5c

Please sign in to comment.