Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6283,7 +6283,7 @@ void TypeChecker::checkConformancesInContext(IterableDeclContext *idc) {
}

if ((existingModule != dc->getParentModule() && conformanceInOrigModule) ||
isSendable) {
diag.Protocol->isMarkerProtocol()) {
// Warn about the conformance.
if (isSendable && SendableConformance &&
isa<InheritedProtocolConformance>(SendableConformance)) {
Expand Down
7 changes: 7 additions & 0 deletions test/decl/protocol/conforms/redundant_conformance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@ class Class3 {
class SomeMockClass: Class3.ProviderThree { // okay
var someInt: Int = 5
}


class ImplicitCopyable {}

class InheritImplicitCopyable: ImplicitCopyable, Copyable {}
// expected-warning@-1 {{redundant conformance of 'InheritImplicitCopyable' to protocol 'Copyable'}}
// expected-note@-2 {{'InheritImplicitCopyable' inherits conformance to protocol 'Copyable' from superclass here}}