mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
facilities used by operators etc. This required a bunch of changes to make
the diagnostics changes strictly an improvement:
- Teach the new path about calls to TypeExprs.
- Teach evaluateCloseness some simple things about varargs.
- Make the generic diagnosis logic produce a better error when there is
exactly one match.
Overall, the resultant diagnostics are a step forward: we now produce candidate
set notes more uniformly, and the messages about some existing ones are
more specific. This is just another stepping stone towards progress though.
Swift SVN r30057
19 lines
988 B
Swift
19 lines
988 B
Swift
// RUN: %target-build-swift -parse %s -Xfrontend -verify
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: OS=macosx
|
|
|
|
import CoreServices
|
|
|
|
func testFSEventStreamRef(stream: FSEventStreamRef) {
|
|
// FIXME: These should be distinct types, constructible from one another.
|
|
_ = stream as ConstFSEventStreamRef // works by coincidence because both are currently COpaquePointer
|
|
_ = ConstFSEventStreamRef(stream) // expected-error {{cannot find an initializer for type 'ConstFSEventStreamRef' that accepts an argument list of type '(FSEventStreamRef)'}}
|
|
// expected-note @-1 {{overloads for 'ConstFSEventStreamRef' exist with these partially matching parameter lists: (), (bitPattern: Word), (bitPattern: UWord), (UnsafePointer<T>), (UnsafeMutablePointer<T>), (nilLiteral: ())}}
|
|
|
|
// This is not a CF object.
|
|
FSEventStreamRetain(stream) // no-warning
|
|
FSEventStreamRelease(stream)
|
|
|
|
let _: AnyObject = stream // expected-error {{'FSEventStreamRef' does not conform to protocol 'AnyObject'}}
|
|
}
|