Skip to content

Commit 5e4fbc4

Browse files
committed
[Diagnostics] Stage in the new error message for existential types that
must be marked with 'any' as a warning.
1 parent f7a82ac commit 5e4fbc4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,7 +4085,8 @@ class ExistentialTypeVisitor
40854085
if (proto->existentialRequiresAny()) {
40864086
Ctx.Diags.diagnose(comp->getNameLoc(),
40874087
diag::existential_requires_any,
4088-
proto->getName());
4088+
proto->getName())
4089+
.limitBehavior(DiagnosticBehavior::Warning);
40894090
}
40904091
} else if (auto *alias = dyn_cast_or_null<TypeAliasDecl>(comp->getBoundDecl())) {
40914092
auto type = Type(alias->getDeclaredInterfaceType()->getDesugaredType());
@@ -4101,7 +4102,8 @@ class ExistentialTypeVisitor
41014102

41024103
Ctx.Diags.diagnose(comp->getNameLoc(),
41034104
diag::existential_requires_any,
4104-
protoDecl->getName());
4105+
protoDecl->getName())
4106+
.limitBehavior(DiagnosticBehavior::Warning);
41054107
}
41064108
}
41074109
return false;

0 commit comments

Comments
 (0)