Files
swift-mirror/test/Constraints/rdar65254452.swift
Pavel Yaskevich d89c096af7 [Diagnostics] Do more checking before recording force downcast fix
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
2020-08-03 16:45:34 -07:00

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]'}}
}