mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change ImplicitlyUnwrappedOptional to be an enum type itself,
not a struct wrapping an Optional. Among other things, this means you can now pattern-match on an IUO. It also makes it more convenient to build and destroy them. SILGen's type lowering should probably canonicalize one kind of optional to the other so that we don't get silly abstraction costs from conversion. Swift SVN r18991
This commit is contained in:
@@ -1291,7 +1291,7 @@ static bool isPrivilegedAccessToImplicitlyUnwrappedOptional(DeclContext *DC,
|
||||
}
|
||||
|
||||
Type ConstraintSystem::lookThroughImplicitlyUnwrappedOptionalType(Type type) {
|
||||
if (auto boundTy = type->getAs<BoundGenericStructType>()) {
|
||||
if (auto boundTy = type->getAs<BoundGenericEnumType>()) {
|
||||
auto boundDecl = boundTy->getDecl();
|
||||
if (boundDecl == TC.Context.getImplicitlyUnwrappedOptionalDecl() &&
|
||||
!isPrivilegedAccessToImplicitlyUnwrappedOptional(DC, boundDecl))
|
||||
|
||||
Reference in New Issue
Block a user