[AltStoreCore] Flattens optional values when @Managed/@AsyncManaged.wrappedValue is also optional

This commit is contained in:
Riley Testut
2023-05-11 15:03:29 -05:00
parent 731d382af8
commit aa138b9461
4 changed files with 46 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
//
// OptionalProtocol.swift
// AltStoreCore
//
// Created by Riley Testut on 5/11/23.
// Copyright © 2023 Riley Testut. All rights reserved.
//
import Foundation
// Public so we can use as generic constraint.
public protocol OptionalProtocol
{
associatedtype Wrapped
static var none: Self { get }
}
extension Optional: OptionalProtocol {}