Skip to content

Commit 1747ac7

Browse files
author
Max Moiseev
committed
[stdlib] doc comments on Integer initializers
1 parent fb7b717 commit 1747ac7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/Prototypes/Integers.swift.gyb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,19 @@ public protocol Integer : ${IntegerBase} {
268268
@warn_unused_result
269269
func isLess(than rhs: Self) -> Bool
270270

271+
/// Creates an instance of `Self` from the value of any other `Integer`,
272+
/// trapping if value of `source` cannot be represented by `Self`.
271273
init<T : Integer>(_ source: T)
274+
275+
/// Creates in instance of `Self` from the value of any other `Integer`,
276+
/// using bits from `source` up to the available width of `Self`, if `T` is
277+
/// wider than `Self`, and filling extra bits on the left with sign bit
278+
/// value otherwise.
272279
init<T : Integer>(extendingOrTruncating source: T)
280+
281+
/// Creates in instance of `Self` from the value of any other `Integer`,
282+
/// resulting in `Self.min` (or `Self.max`) if the value cannot be represented
283+
/// by `Self`, and exact value of `source` otherwise.
273284
init<T : Integer>(clamping source: T)
274285

275286
/// Return n-th word in the underlying representation of `self`.

0 commit comments

Comments
 (0)