Jon Bailey
02/21/2024, 6:52 PMonEnum(of:)
functions. Would it be possible to add @_disfavoredOverload
to the optional one?Filip Dolník
02/22/2024, 1:33 PM@_disfavoredOverload
isn’t ideal and I want to look for other options first. This attribute is unstable and the docs explicitly mentions that it should only be used for workarounding compiler bugs which I’m not sure is this case.Jon Bailey
02/22/2024, 4:19 PMlet kotlin: SharedSealedClass = ..
let swift: Skie.Features.SharedSealedClass.__Sealed? = onEnum(of: kotlin)
And yep it’s a bit unsettling that it’s underscored but SwiftUI uses it for the Text view so it’s not unused. https://forums.swift.org/t/how-to-determine-if-a-passed-argument-is-a-string-literal/41651 (from https://www.fivestars.blog/articles/disfavoredOverload/)
Otherwise a third onEnum(of:) would be able to fix the ambiguity without the use of disfavoredOverloadJon Bailey
02/22/2024, 4:21 PMFilip Dolník
02/22/2024, 5:52 PMFilip Dolník
03/12/2024, 8:53 AM