Dates: make DateFormat parse errors compile under `--trim=safe` #64621
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 299 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #64621"
general
weight: 0.35
KristofferC
Why
juliac --trim=saferejects every program that parses text with aDates.DateFormat. That coversDate(text),DateTime(text, format),Time(text, format), andTimestamp(text). The verifier reports an unresolvedstringcall on the parser's error path, atstdlib/Dates/src/parse.jl:104.The "Expected directive" message prints
directives[directive_index]. That is a runtime index into the format's tuple of directives, whose element types differ, so inference widens the element to a union with the abstractDatePart. Thestringcall on it can't be resolved statically.This came up in Durations.jl and Postgres.jl, which want trimmed programs to parse timestamps with Dates' own parser instead of carrying their own.
Change
tryparsenext_corebuilds a tuple of the directives' printed forms, with onestring(directives[i])call per directive, and indexes that instead. Each call sees its directive's concrete type. The message text is unchanged, and the strings are built only on the error path.test/trim/Trimmabilitynow parses aDateand aDateTimewith aDateFormat. The build fails verification without the fix.Verification
_test_dates()fails the verifier on 1.14.0-alpha2, with 4 errors atparse.jl:104. With the fix loaded, it builds and printsdates: 2026-03-08 2026-03-08T16:00:00.500.Date,DateTime, andTimestamptext with default and custom formats, includingtryparseand the error path. On 1.14.0-alpha2 its 10 errors atparse.jl:104go away. The executable throws the usual message, "Unable to parse date time. Expected directive Delim(:) at char 17".tryparsenext_coreloaded over the stdlib's: 147 testsets and 7,732,903 tests, the same count as without it. Nightly'sparse.jlis identical to master's.test/trimTrimmability target itself has not run here.Backports
The same line is on
release-1.12,release-1.13, andrelease-1.14. On 1.13.3, applying this change alone madeDateandDateTimeparsing with aDateFormatcompile under--trim=safein the same test programs.🤖 Generated with Claude Code