Files
swift-mirror/test/ModuleInterface/skip-redundant-conformances.swift
Xi Ge 45d0eca9c7 ModuleInterface: consider inherited protocols from super class when collecting handled protocols
Protocol conformances can be implied by super classes. When collecting the list
of IncludedProtocols, we should traverse the class inheritance chain and collect
all protocols.

Without this change, these implied conformances will be printed again via a synthesized
extension at the end of the Swift interface file, leading to an error of redundant
conformances when building modules.

rdar://58563540
2020-03-18 17:21:13 -07:00

11 lines
420 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -typecheck -module-name Foo -emit-module-interface-path %t/Foo.swiftinterface %s
// RUN: %target-swift-frontend -compile-module-from-interface %t/Foo.swiftinterface -o %t/Foo.swiftmodule
public protocol ProtocolA : class {}
public protocol ProtocolB: ProtocolA {}
protocol ProtocolC: ProtocolA {}
public class A: ProtocolB {}
public class B: A, ProtocolC {}