Files
swift-mirror/test/stdlib/StringCompatibilityDiagnostics.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

19 lines
837 B
Swift

// RUN: %target-swift-frontend -typecheck -swift-version 5 %s -verify -verify-ignore-unrelated
func testPopFirst() {
let str = "abc"
let charView: String.CharacterView // expected-error{{'CharacterView' is unavailable: Please use String directly}}
_ = str.characters // expected-error{{'characters' is unavailable: Please use String directly}}
dump(charView)
var substr = str[...]
_ = substr.popFirst() // ok
_ = substr.characters.popFirst() // expected-error{{'characters' is unavailable: Please use Substring directly}}
_ = substr.unicodeScalars.popFirst() // ok
let charSubView: Substring.CharacterView // expected-error{{'CharacterView' is unavailable: Please use Substring directly}}
_ = substr.characters // expected-error{{'characters' is unavailable: Please use Substring directly}}
dump(charSubView)
}