Skip to content

Commit 70a6f45

Browse files
committed
stdlib: Add unavailable declaration for readline(stripNewline:)
1 parent 3a27456 commit 70a6f45

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

stdlib/public/core/InputStream.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ public func readLine(strippingNewline: Bool = true) -> String? {
6666
_swift_stdlib_free(linePtr)
6767
return result
6868
}
69+
70+
@available(*, unavailable, renamed: "readLine(strippingNewline:)")
71+
public func readLine(stripNewline: Bool = true) -> String? {
72+
Builtin.unreachable()
73+
}

test/1_stdlib/Renames.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ func _Index() {
240240
func fn3<T : RandomAccessIndexType>(_: T) {} // expected-error {{'RandomAccessIndexType' has been renamed to 'Strideable'}} {{16-37=Strideable}} {{none}}
241241
}
242242

243+
func _InputStream() {
244+
_ = readLine(stripNewline: true) // expected-error {{'readLine(stripNewline:)' has been renamed to 'readLine(strippingNewline:)'}} {{7-15=readLine}} {{16-28=strippingNewline}} {{none}}
245+
_ = readLine() // ok
246+
}
247+
243248
func _IntegerArithmetic() {
244249
func fn1<T : IntegerArithmeticType>(_: T) {} // expected-error {{'IntegerArithmeticType' has been renamed to 'IntegerArithmetic'}} {{16-37=IntegerArithmetic}} {{none}}
245250
func fn2<T : SignedNumberType>(_: T) {} // expected-error {{'SignedNumberType' has been renamed to 'SignedNumber'}} {{16-32=SignedNumber}} {{none}}

0 commit comments

Comments
 (0)