Skip to content

Commit 03338c2

Browse files
authored
Merge pull request swiftlang#36114 from CodaFi/opt-in
2 parents 0784af5 + 326fc09 commit 03338c2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/AST/Type.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,6 @@ Type TypeBase::replaceCovariantResultType(Type newResultType,
818818

819819
auto loadedTy = getWithoutSpecifierType();
820820
if (auto objectType = loadedTy->getOptionalObjectType()) {
821-
assert(!newResultType->getOptionalObjectType());
822821
newResultType = OptionalType::get(
823822
objectType->replaceCovariantResultType(newResultType, uncurryLevel));
824823
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %target-swift-frontend -typecheck %s
2+
3+
extension Optional {
4+
init?() {
5+
self.init(nilLiteral: Void())
6+
}
7+
}

0 commit comments

Comments
 (0)