Repository navigation
fix(FlagEvaluation): remove dead getTyped cast - #272
Merged
nicklasl merged 1 commit intoNov 2, 2026
Merged
Conversation
Removes the unreachable 'self as? T' check in getTyped(), ensuring all flag values are evaluated via switch value.type(). Resolves spotify#252 Signed-off-by: reginaldalfret <[email protected]>
reginaldalfret
requested review from
andreas-karlsson,
fabriziodemaria,
mfranberg,
nicklasl and
vahidlazio
as code owners
October 5, 2026 09:23
nicklasl
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #252
As noted by maintainer @fabriziodemaria in #271, the initial check:
\\swift
if let value = self as? T {
return value
}
\
is dead code because \self\ is \FlagResolution.
Attempting to change it to \�alue as? T\ is also incorrect because \�alue\ is a \ConfidenceValue\ wrapper (casting it directly to primitive types evaluates to
il, and casting for \ConfidenceValue\ / \Any\ / \AnyObject\ would bypass the switch and skip the .null -> nil\ path).
Following maintainer guidance, this PR deletes the dead check completely so all evaluations reliably go through \switch value.type().
Checklist