Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4468,9 +4468,6 @@ ERROR(attr_pre_inverse_generics_invalid_except,none,
WARNING(attr_pre_inverse_generics_except_all,none,
"'@_preInverseGenerics' that excepts all inverse constraints is "
"equivalent to not using the attribute", ())
WARNING(attr_pre_inverse_generics_on_extension,none,
"'@_preInverseGenerics' has no effect on an extension; place it on "
"individual members instead", ())

// lazy
ERROR(lazy_not_on_let,none,
Expand Down
6 changes: 0 additions & 6 deletions lib/Sema/TypeCheckAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8712,12 +8712,6 @@ void AttributeChecker::visitMacroRoleAttr(MacroRoleAttr *attr) {

void AttributeChecker::visitPreInverseGenericsAttr(
PreInverseGenericsAttr *attr) {
if (isa<ExtensionDecl>(D)) {
diagnose(attr->getLocation(),
diag::attr_pre_inverse_generics_on_extension);
return;
}

if (attr->hasExcept(D) &&
!Ctx.LangOpts.hasFeature(Feature::PreInverseGenericsExcept)) {
Ctx.Diags
Expand Down
8 changes: 0 additions & 8 deletions test/Sema/preInverseGenerics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,3 @@ func bad2() {}
// positive protocol (not inverted)
@_preInverseGenerics(except: Copyable) // expected-error {{'except' argument to '@_preInverseGenerics' must consist only of inverse constraints such as '~Copyable' or '~Escapable'}}
func bad3() {}

// Warning: attribute on extension has no effect
struct S<T: ~Copyable>: ~Copyable {}

@_preInverseGenerics // expected-warning {{'@_preInverseGenerics' has no effect on an extension; place it on individual members instead}}
extension S where T: ~Copyable {
func extMethod() {}
}