From 8a4821c4e784eca209a1624d6bad59312fceeba7 Mon Sep 17 00:00:00 2001 From: Jen Basch Date: Mon, 4 May 2026 13:53:40 -0700 Subject: [PATCH] Power assertions: change source section check to an assert (#1572) --- .../src/main/java/org/pkl/core/runtime/PowerAssertions.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkl-core/src/main/java/org/pkl/core/runtime/PowerAssertions.java b/pkl-core/src/main/java/org/pkl/core/runtime/PowerAssertions.java index 1593b513..bd054639 100644 --- a/pkl-core/src/main/java/org/pkl/core/runtime/PowerAssertions.java +++ b/pkl-core/src/main/java/org/pkl/core/runtime/PowerAssertions.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Map; import java.util.function.Consumer; import java.util.stream.Collectors; -import org.pkl.core.PklBugException; import org.pkl.core.ast.ConstantValueNode; import org.pkl.core.ast.expression.member.InferParentWithinMethodNode; import org.pkl.core.ast.expression.member.InferParentWithinObjectMethodNode; @@ -84,10 +83,7 @@ public class PowerAssertions { SourceSection sourceSection, Map> trackedValues, @Nullable Consumer firstFrameSuffix) { - if (!sourceSection.isAvailable()) { - throw new PklBugException("Power assertions require an available source section"); - } - + assert sourceSection.isAvailable() : "Power assertions require an available source section"; out.appendSandboxed( () -> { var lines = lines(sourceSection);