Skip to content

Commit 0e35bad

Browse files
committed
Revert "[stdlib] Remove workarounds for fixed bug"
This reverts commit r30148, since it regresses the following tests: Swift :: ClangModules/script.swift Swift :: Interpreter/currying_protocols.swift Swift :: Interpreter/if_expr.swift Swift :: Interpreter/protocol_extensions.swift Swift :: Interpreter/weak.swift Swift :: Interpreter/weak_objc.swift Swift :: PlaygroundTransform/array_did_set.swift Swift :: PlaygroundTransform/print.swift Swift SVN r30159
1 parent 7573aeb commit 0e35bad

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

stdlib/public/core/OutputStream.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public func toDebugString<T>(x: T) -> String {
379379
@inline(never)
380380
@_semantics("stdlib_binary_only")
381381
public func print<T, TargetStream : OutputStreamType>(
382-
value: T, inout _ target: TargetStream, appendNewline: Bool = true
382+
value: T, inout _ target: TargetStream, appendNewline: Bool
383383
) {
384384
target._lock()
385385
_print_unlocked(value, &target)
@@ -389,6 +389,15 @@ public func print<T, TargetStream : OutputStreamType>(
389389
target._unlock()
390390
}
391391

392+
@inline(never)
393+
@_semantics("stdlib_binary_only")
394+
public func print<T, TargetStream : OutputStreamType>(
395+
value: T, inout _ target: TargetStream
396+
) {
397+
// FIXME: workaround for rdar://20775669
398+
print(value, &target, appendNewline: true)
399+
}
400+
392401
/// Writes the textual representation of `value`, and an optional newline,
393402
/// into the standard output.
394403
///
@@ -405,7 +414,7 @@ public func print<T, TargetStream : OutputStreamType>(
405414
/// newline.
406415
@inline(never)
407416
@_semantics("stdlib_binary_only")
408-
public func print<T>(value: T, appendNewline: Bool = true) {
417+
public func print<T>(value: T, appendNewline: Bool) {
409418
var target = _Stdout()
410419
target._lock()
411420
_print_unlocked(value, &target)
@@ -415,6 +424,13 @@ public func print<T>(value: T, appendNewline: Bool = true) {
415424
target._unlock()
416425
}
417426

427+
@inline(never)
428+
@_semantics("stdlib_binary_only")
429+
public func print<T>(value: T) {
430+
// FIXME: workaround for rdar://20775669
431+
print(value, appendNewline: true)
432+
}
433+
418434
//===----------------------------------------------------------------------===//
419435
// debugPrint()
420436
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)