mirror of
https://github.com/apple/swift.git
synced 2026-10-18 17:49:23 +02:00
Add synthesis of the protocol conformances for the known protocols with `@com`. `ISwiftObject` may not be explicitly conformed to, it is a purely compiler managed sealed protocol. Generate a diagnostic for the explicit conformance.
29 lines
857 B
Swift
29 lines
857 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module-path %t/COM.swiftmodule -module-name COM -enable-experimental-com-interop %S/../Inputs/COM.swift
|
|
// RUN: %target-typecheck-verify-swift -enable-experimental-com-interop -I %t
|
|
|
|
import COM
|
|
|
|
// expected-note@+1 {{'@com' automatically provides 'ISwiftObject' conformance}}
|
|
@com
|
|
class CClass1: ISwiftObject {
|
|
}
|
|
// expected-error@-2 {{'ISwiftObject' conformance is compiler-managed and cannot be declared explicitly}}
|
|
|
|
// expected-note@+1 {{'@com' automatically provides 'ISwiftObject' conformance}}
|
|
@com(implementation: "00000000-0000-0000-0000-000000000000")
|
|
class CClass2: ISwiftObject {
|
|
}
|
|
// expected-error@-2 {{'ISwiftObject' conformance is compiler-managed and cannot be declared explicitly}}
|
|
|
|
@com
|
|
class CClass3 {
|
|
}
|
|
|
|
@com
|
|
class CClass4: IUnknown {
|
|
}
|
|
|
|
class CClass5: ISwiftObject {
|
|
}
|