[PrintAsObjC] Include a message when making +new unavailable

Another follow-up to 49c65facc9. We've seen a few people run into
this and not know what changed.

rdar://problem/35942058
This commit is contained in:
Jordan Rose
2017-12-13 17:33:01 -08:00
parent 9ddd60d4ef
commit 7493eccaa9
4 changed files with 6 additions and 5 deletions

View File

@@ -679,7 +679,8 @@ private:
if (makeNewUnavailable) {
assert(!makeNewExplicitlyAvailable);
os << "+ (nonnull instancetype)new SWIFT_UNAVAILABLE;\n";
os << "+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("
"\"-init is unavailable\");\n";
} else if (makeNewExplicitlyAvailable) {
os << "+ (nonnull instancetype)new;\n";
}