File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -287,9 +287,6 @@ class ActiveSyntaxRewriter<Configuration: BuildConfiguration>: SyntaxRewriter {
287287 return applyBaseToPostfixExpression ( base: base, postfix: postfixExpr)
288288 }
289289
290- // FIXME: PostfixIfConfigExprSyntax has a different form that doesn't work
291- // well with the way dropInactive is written. We essentially need to
292- // thread a the "base" into the active clause.
293290 override func visit( _ node: PostfixIfConfigExprSyntax ) -> ExprSyntax {
294291 let rewrittenNode = dropInactive ( outerBase: nil , postfixIfConfig: node)
295292 if rewrittenNode == ExprSyntax ( node) {
Original file line number Diff line number Diff line change @@ -51,4 +51,33 @@ public class ActiveRegionTests: XCTestCase {
5151 ]
5252 )
5353 }
54+
55+ func testActiveRegionsInPostfix( ) throws {
56+ try assertActiveCode (
57+ """
58+ 4️⃣a.b()
59+ #if DEBUG
60+ 0️⃣.c()
61+ #elseif ASSERTS
62+ 1️⃣.d()
63+ #if compiler(>=8.0)
64+ 2️⃣.e()
65+ #else
66+ 3️⃣.f()
67+ #endif
68+ #endif
69+ 5️⃣.g()
70+ """ ,
71+ configuration: linuxBuildConfig,
72+ states: [
73+ " 0️⃣ " : . active,
74+ " 1️⃣ " : . inactive,
75+ " 2️⃣ " : . unparsed,
76+ " 3️⃣ " : . inactive,
77+ " 4️⃣ " : . active,
78+ " 5️⃣ " : . active,
79+ ]
80+ )
81+
82+ }
5483}
You can’t perform that action at this time.
0 commit comments