Use ChoiceFormat for better plurals in error messages (#1848)

This commit is contained in:
Jen Basch
2026-09-10 22:03:05 +00:00
committed by GitHub
parent 90245589b6
commit 574ad844f3
6 changed files with 30 additions and 11 deletions
@@ -1,2 +1,2 @@
f = (a1, a2, a3) -> a1
res = f.applyToList(List(1, 2, 3, 4, 5, 6))
f = (a1, a2) -> a1
res = f.applyToList(List(1, 2, 3, 4, 5, 6))
@@ -1,8 +1,8 @@
–– Pkl Error ––
Expected 3 function arguments but got 6.
Expected 2 function arguments but got 6.
x | f = (a1, a2, a3) -> a1
^^^^^^^^^^^^^^^^^^
x | f = (a1, a2) -> a1
^^^^^^^^^^^^^^
at wrongArgumentListLength#f.<function#1> (file:///$snippetsDir/input/lambdas/wrongArgumentListLength.pkl)
x | res = f.applyToList(List(1, 2, 3, 4, 5, 6))