matching_patterns.swift (swift-swift-5.8-RELEASE) | : | matching_patterns.swift (swift-swift-5.8.1-RELEASE) | ||
---|---|---|---|---|
skipping to change at line 303 | skipping to change at line 303 | |||
let arr: [Base] | let arr: [Base] | |||
if case let _ as [Derived] = arr {} | if case let _ as [Derived] = arr {} | |||
// expected-warning@-1 {{'let' pattern has no effect; sub-pattern didn't bind any variables}} | // expected-warning@-1 {{'let' pattern has no effect; sub-pattern didn't bind any variables}} | |||
guard case let _ as [Derived] = arr else {} | guard case let _ as [Derived] = arr else {} | |||
// expected-warning@-1 {{'let' pattern has no effect; sub-pattern didn't bind any variables}} | // expected-warning@-1 {{'let' pattern has no effect; sub-pattern didn't bind any variables}} | |||
while case let _ as [Derived] = arr {} | while case let _ as [Derived] = arr {} | |||
// expected-warning@-1 {{'let' pattern has no effect; sub-pattern didn't bind any variables}} | // expected-warning@-1 {{'let' pattern has no effect; sub-pattern didn't bind any variables}} | |||
// FIXME: https://github.com/apple/swift/issues/61850 | ||||
// expected-warning@+1 {{heterogeneous collection literal could only be inferr | ||||
ed to '[[Base]]'; add explicit type annotation if this is intentional}} | ||||
for case _ as [Derived] in [arr] {} | for case _ as [Derived] in [arr] {} | |||
if case is [Derived] = arr {} | if case is [Derived] = arr {} | |||
guard case is [Derived] = arr else {} | guard case is [Derived] = arr else {} | |||
while case is [Derived] = arr {} | while case is [Derived] = arr {} | |||
for case is [Derived] in [arr] {} | for case is [Derived] in [arr] {} | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 0 lines changed or added |