Power assertions: change source section check to an assert (#1572)

This commit is contained in:
Jen Basch
2026-05-04 13:53:40 -07:00
committed by GitHub
parent b7ba6a8649
commit 8a4821c4e7
@@ -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<Node, List<Object>> trackedValues,
@Nullable Consumer<AnsiStringBuilder> 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);