mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Solver should do more checking upfront before recording `force downcast` fix, to make sure that it's indeed always applicable when recorded, otherwise it would be possible to misdiagnose or omit diagnostics in certain situations. Resolves: rdar://problem/65254452
18 lines
389 B
Swift
18 lines
389 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
class Obj: NSObject {
|
|
}
|
|
|
|
class Container {
|
|
var objects: [Obj]
|
|
init(objects: [Obj]) {}
|
|
}
|
|
|
|
func test(other: Container) {
|
|
_ = Container(objects: other)
|
|
// expected-error@-1 {{cannot convert value of type 'Container' to expected argument type '[Obj]'}}
|
|
}
|