Hi, currently if passing in a non optional value into onEnum(of:) and storing the result in an optional field, there is ambiguity between the two generated
onEnum(of:)
functions. Would it be possible to add
@_disfavoredOverload
to the optional one?
f
Filip Dolník
02/22/2024, 1:33 PM
Hi! I will look into it. This particular use case wasn’t something we considered when we designed and tested the function so we were under the impression that it will not cause such conflicts.
My first thought is that using
@_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.
j
Jon Bailey
02/22/2024, 4:19 PM
The ambiguity is in this case:
Copy code
let kotlin: SharedSealedClass = ..
let swift: Skie.Features.SharedSealedClass.__Sealed? = onEnum(of: kotlin)