We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc8121a commit f552d01Copy full SHA for f552d01
core/common/src/internal/format/parser/ParserOperation.kt
@@ -50,7 +50,12 @@ internal class NumberSpanParserOperation<Output>(
50
51
init {
52
require(consumers.all { (it.length ?: Int.MAX_VALUE) > 0 })
53
- require(consumers.count { it.length == null } <= 1)
+ require(consumers.count { it.length == null } <= 1) {
54
+ val fieldNames = consumers.filter { it.length == null }.map { it.whatThisExpects }
55
+ "At most one variable-length numeric field in a row is allowed, but got several: $fieldNames. " +
56
+ "Parsing is undefined: for example, with variable-length month number " +
57
+ "and variable-length day of month, '111' can be parsed as Jan 11th or Nov 1st."
58
+ }
59
}
60
61
private val whatThisExpects: String
0 commit comments