Skip to content

Commit 10afd15

Browse files
committed
Following up on r31169, take Jordan's CR feedback and uncomment the two currently disabled migration aid overloads for 'print'.
Swift SVN r31176
1 parent f5b1efb commit 10afd15

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

lib/Sema/CSApply.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -3283,9 +3283,7 @@ namespace {
32833283

32843284
// Coerce the object type, if necessary.
32853285
auto subExpr = expr->getSubExpr();
3286-
if (auto opTy = dyn_cast<OptionalType>(subExpr->getType().getPointer())) {
3287-
auto objectTy = opTy->getAnyOptionalObjectType();
3288-
3286+
if (auto objectTy = subExpr->getType()->getAnyOptionalObjectType()) {
32893287
if (objectTy && !objectTy->isEqual(valueType)) {
32903288
auto coercedSubExpr = coerceToType(subExpr,
32913289
OptionalType::get(valueType),

stdlib/public/core/Print.swift

-2
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,10 @@ internal func _debugPrint<Target: OutputStreamType>(
146146
//===----------------------------------------------------------------------===//
147147
//===--- Migration Aids ---------------------------------------------------===//
148148

149-
/* FIXME: Disabled because we need these signatures for our workarounds below
150149
@available(*, unavailable, message="Please wrap your tuple argument in parentheses: 'print((...))'")
151150
public func print<T>(_: T) {}
152151
@available(*, unavailable, message="Please wrap your tuple argument in parentheses: 'debugPrint((...))'")
153152
public func debugPrint<T>(_: T) {}
154-
*/
155153

156154
@available(*, unavailable, message="Please use 'terminator: \"\"' instead of 'appendNewline: false': 'print((...), terminator: \"\")'")
157155
public func print<T>(_: T, appendNewline: Bool) {}

test/1_stdlib/PrintDiagnostics.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ print(3, &stream) // expected-error {{'&' can only appear immediately in a call
1212
debugPrint(3, &stream) // expected-error {{'&' can only appear immediately in a call argument list}}
1313
print(3, &stream, appendNewline: false) // expected-error {{cannot invoke 'print' with an argument list of type}} expected-note {{expected an argument list of type}}
1414
debugPrint(3, &stream, appendNewline: false) // expected-error {{cannot invoke 'debugPrint' with an argument list of type}} expected-note {{expected an argument list of type}}
15-
print(4, quack: 5) // expected-error {{cannot invoke 'print' with an argument list of type '(Int, quack: Int)'}} expected-note {{expected an argument list of type '(Any..., separator: String, terminator: String)'}}
15+
print(4, quack: 5) // expected-error {{'print' is unavailable: Please wrap your tuple argument in parentheses: 'print((...))'}}

0 commit comments

Comments
 (0)