Files
pkl/pkl-core
Jen Basch 2c74108a6a Do not activate power assertions when a single union member containing a type constraint fails (#1462)
Prior to this change, this code would activate powers assertions /
instrumentation permanently:
```pkl
foo: String(contains("a")) | String(contains("b")) = "boo"
```

This is because the `contains("a")` constraint would fail, triggering
power assertions, but the subsequent check of the union's
`contains("b")` branch would succeed.
As observed in #1419, once instrumentation is enabled, all subsequent
evaluation slows significantly.
As with #1419, the fix here is to disable power assertions via
`VmLocalContext` until we know that all union members failed type
checking; then, each member is re-executed with power assertions allowed
to provide the improved user-facing error.
2026-03-25 12:13:21 -07:00
..
2024-02-01 14:00:22 -08:00

Core implementation of the Pkl language. Includes Java APIs for embedding the
language into JVM applications, and for building libraries and tools on top of
the language.