Files
swift-mirror/test/Sema/COM-ISwiftObject.swift
Saleem Abdulrasool 4ae91bec2c AST,Sema: synthesize IUnknown, ISwiftObject conformances
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.
2026-07-07 22:50:05 -07:00

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 {
}