Skip to content

Commit 00fb7a0

Browse files
committed
Adapt to optionality changes on main
1 parent 1b0f44a commit 00fb7a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftIfConfig/IfConfigEvaluation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private func evaluateIfConfig(
196196

197197
// Logical '!'.
198198
if let prefixOp = condition.as(PrefixOperatorExprSyntax.self),
199-
prefixOp.operator?.text == "!"
199+
prefixOp.operator.text == "!"
200200
{
201201
return try !evaluateIfConfig(condition: prefixOp.expression, configuration: configuration)
202202
}
@@ -249,13 +249,13 @@ private func evaluateIfConfig(
249249
// Ensure that we have a single unlabeled argument that is either >= or < as a prefix
250250
// operator applied to a version.
251251
guard let argExpr = call.arguments.singleUnlabeledExpression,
252-
let unaryArg = argExpr.as(PrefixOperatorExprSyntax.self),
253-
let opToken = unaryArg.operator
252+
let unaryArg = argExpr.as(PrefixOperatorExprSyntax.self)
254253
else {
255254
throw IfConfigError.requiresUnlabeledArgument(name: fnName, role: "version comparison (>= or <= a version)")
256255
}
257256

258257
// Parse the version.
258+
let opToken = unaryArg.operator
259259
guard let version = VersionTuple(parsing: unaryArg.expression.trimmedDescription) else {
260260
throw IfConfigError.invalidVersionOperand(name: fnName, syntax: unaryArg.expression)
261261
}

0 commit comments

Comments
 (0)