Remove most uses of OptionalTypeKind.

What remains are places where we are conflating optionality with
either nullability or failability.
This commit is contained in:
Mark Lacey
2018-02-08 12:26:57 -08:00
parent 94a35a1b4c
commit d63bb3fc53
28 changed files with 176 additions and 381 deletions

View File

@@ -858,9 +858,7 @@ namespace {
return emitSameType(source, target);
// Handle subtype conversions involving optionals.
OptionalTypeKind sourceOptKind;
if (auto sourceObjectType =
source.FormalType.getOptionalObjectType(sourceOptKind)) {
if (auto sourceObjectType = source.FormalType.getOptionalObjectType()) {
return emitOptionalToOptional(source, sourceObjectType, target);
}
assert(!target.FormalType.getOptionalObjectType());