mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 08:09:17 +02:00
Power assertions: change source section check to an assert (#1572)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user