Skip to content

Commit 2298307

Browse files
Merge pull request swiftlang#25 from airspeedswift/utf8-diag-tests
[utf8] Fix some simple test failures
2 parents ae15cfb + ecf5c77 commit 2298307

File tree

6 files changed

+4
-73
lines changed

6 files changed

+4
-73
lines changed

stdlib/public/SDK/Foundation/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ add_swift_library(swiftFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SD
1313
DateComponents.swift
1414
DateInterval.swift
1515
Decimal.swift
16-
ExtraStringAPIs.swift
1716
FileManager.swift
1817
Foundation.swift
1918
IndexPath.swift

stdlib/public/SDK/Foundation/ExtraStringAPIs.swift

Lines changed: 0 additions & 33 deletions
This file was deleted.

stdlib/public/core/StringUTF16View.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,6 @@ extension String {
200200
public init(_ utf16: UTF16View) {
201201
self.init(utf16._guts)
202202
}
203-
204-
#if _runtime(_ObjC)
205-
// These may become less important once <rdar://problem/19255291> is addressed.
206-
@available(
207-
*, unavailable,
208-
message: "Indexing a String's UTF16View requires a String.UTF16View.Index, which can be constructed from Int when Foundation is imported")
209-
public subscript(i: Int) -> UTF16.CodeUnit {
210-
Builtin.unreachable()
211-
}
212-
213-
@available(
214-
*, unavailable,
215-
message: "Slicing a String's UTF16View requires a Range<String.UTF16View.Index>, String.UTF16View.Index can be constructed from Int when Foundation is imported")
216-
public subscript(bounds: Range<Int>) -> UTF16View {
217-
Builtin.unreachable()
218-
}
219-
#endif
220203
}
221204

222205
// Index conversions

stdlib/public/core/old_StringUTF16View.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -239,24 +239,6 @@ extension String {
239239
return UTF16._replacementCodeUnit
240240
}
241241

242-
#if _runtime(_ObjC)
243-
// These may become less important once <rdar://problem/19255291> is addressed.
244-
245-
@available(
246-
*, unavailable,
247-
message: "Indexing a String's UTF16View requires a String.UTF16View.Index, which can be constructed from Int when Foundation is imported")
248-
public subscript(i: Int) -> UTF16.CodeUnit {
249-
Builtin.unreachable()
250-
}
251-
252-
@available(
253-
*, unavailable,
254-
message: "Slicing a String's UTF16View requires a Range<String.UTF16View.Index>, String.UTF16View.Index can be constructed from Int when Foundation is imported")
255-
public subscript(bounds: Range<Int>) -> UTF16View {
256-
Builtin.unreachable()
257-
}
258-
#endif
259-
260242
@inlinable // FIXME(sil-serialize-all)
261243
internal init(_ _guts: _StringGuts) {
262244
self.init(_guts, offset: 0, length: _guts.count)

test/Constraints/rdar42678836.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %target-typecheck-verify-swift
22

33
func foo(chr: Character) -> String {
4-
return String(repeating: String(chr)) // expected-error {{incorrect argument label in call (have 'repeating:', expected 'stringLiteral:')}}
4+
return String(repeating: String(chr)) // expected-error {{argument labels '(repeating:)' do not match any available overloads}} expected-note {{overloads for 'String' exist with these partially matching parameter lists: (Character), (from: Decoder), (cString: UnsafePointer<CChar>), (cString: UnsafePointer<UInt8>), (validatingUTF8: UnsafePointer<CChar>), (_builtinUnicodeScalarLiteral: Int32), (Unicode.Scalar), (stringLiteral: String), (T), (String), (_cocoaString: AnyObject), (stringInterpolation: String...), (stringInterpolationSegment: T), (T, radix: Int, uppercase: Bool), (S), (String.UnicodeScalarView), (String.UTF16View), (String.UTF8View), (Substring), (Substring.UTF8View), (Substring.UTF16View), (Substring.UnicodeScalarView), (String, obsoletedInSwift4: ()), (describing: Subject), (reflecting: Subject)}}
55
}

test/Generics/deduction.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func foo() {
323323

324324
infix operator +&
325325
func +&<R, S>(lhs: inout R, rhs: S) where R : RangeReplaceableCollection, S : Sequence, R.Element == S.Element {}
326-
// expected-note@-1 {{candidate requires that the types 'String' and 'Character' be equivalent (requirement specified as 'R.Element' == 'S.Element' [with R = [String], S = String])}}
326+
// expected-note@-1 {{candidate requires that the types 'String' and 'String.Element' (aka 'Character') be equivalent (requirement specified as 'R.Element' == 'S.Element' [with R = [String], S = String])}}
327327

328328
func rdar33477726_1() {
329329
var arr: [String] = []
@@ -332,13 +332,13 @@ func rdar33477726_1() {
332332
}
333333

334334
func rdar33477726_2<R, S>(_: R, _: S) where R: Sequence, S == R.Element {}
335-
// expected-note@-1 {{candidate requires that the types 'Int' and 'Character' be equivalent (requirement specified as 'S' == 'R.Element' [with R = String, S = Int])}}
335+
// expected-note@-1 {{candidate requires that the types 'Int' and 'String.Element' (aka 'Character') be equivalent (requirement specified as 'S' == 'R.Element' [with R = String, S = Int])}}
336336
rdar33477726_2("answer", 42)
337337
// expected-error@-1 {{cannot invoke 'rdar33477726_2(_:_:)' with an argument list of type '(String, Int)'}}
338338

339339
prefix operator +-
340340
prefix func +-<T>(_: T) where T: Sequence, T.Element == Int {}
341-
// expected-note@-1 {{candidate requires that the types 'Character' and 'Int' be equivalent (requirement specified as 'T.Element' == 'Int' [with T = String])}}
341+
// expected-note@-1 {{candidate requires that the types 'String.Element' (aka 'Character') and 'Int' be equivalent (requirement specified as 'T.Element' == 'Int' [with T = String])}}
342342

343343
+-"hello"
344344
// expected-error@-1 {{unary operator '+-(_:)' cannot be applied to an operand of type 'String'}}

0 commit comments

Comments
 (0)