CLOVIS
06/08/2026, 8:28 PMYoussef Shoaib [MOD]
06/08/2026, 8:47 PMAlternatively, if a mandatory parameter is placed after a default parameter, a user who wants to use positional syntax is forced to specify the default parameter too:
I think your example has a typo; likely what you meant was:
fun foo(
a: Int,
b: String = "default",
c: Boolean,
)
foo(a, "default", false)
// I cannot specify 'c' without specifying 'b'
That comment should probably say "positionally" as well, but it's implied in the contextYoussef Shoaib [MOD]
06/08/2026, 8:51 PMpositional parameters are forbidden after a vararg parameter
I did a double take at this line. The context explains it sufficiently, so I am being pedantic, but I believe you meant positional arguments are forbidden after vararg. Although maybe you do mean that parameters that come after vararg aren't positional? That is very true, but "forbidden" makes it sound like it's a compiler error, while a parameter being positional or not is contractual, and isn't in the declaration itself.
Youssef Shoaib [MOD]
06/08/2026, 8:53 PMCLOVIS
06/09/2026, 7:11 AMI did a double take at this line. The context explains it sufficiently, so I am being pedantic, but I believe you meant positional arguments are forbidden after vararg.Correct, fixed 🙏
CLOVIS
06/09/2026, 7:12 AMCLOVIS
06/09/2026, 7:13 AM