-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug panic in datetime #6205
Comments
Possibly related: #5892 |
Conveniently {
"has_explicit_medium": true,
"has_explicit_short": true,
"variant_pattern_indices": [
0,
0,
0,
4,
5,
6
],
"elements": [
"EEEE, d MMMM y г.",
"E, d MMM y г.",
"ccc, dd.MM.y г.",
"EEEE, d MMMM y г. GGG",
"E, d MMM y г. GGG",
"E, dd MMM y г. GGG"
]
} So for whatever reason, the pattern in question has I suspect that the issue might be an inconsistency between the year style variants. The data model is documented here: https://unicode-org.github.io/icu4x/rustdoc/icu/datetime/provider/struct.PackedPatterns.html For a Short length, all of these patterns are reachable depending on the input year:
Aha, so the resolution of year style results in different data for the weekday field (and also the month field, but this is not a concern because one is numeric). This is problematic because Two things that need to be fixed, and solutions:
I'm leaning toward 2iii and either 1i or 1iii. Thoughts? @robertbastian @Manishearth @zbraniecki |
It's worrying that this happens in the format function, where your mantra so far has been "infallible if using field sets". We don't seem to have the test coverage to back up this claim, we test a handful of locales against a handful of field sets. Is it feasible to test all locales x calendars x field sets? |
My immediate reaction to this is that this is a datagen concern, which should try to normalize it or something. Which seems to be 2iii?
If we keep the assertion, having it be sooner sounds correct to me. Silent fallback sounds nice too, though. |
The claim has been "infallible if using field sets and if data is valid." Which would infer that the data here is invalid, i.e. a datagen bug, unless this uncovers a case we hadn't considered before.
No, we don't. Once we get data-driven testing wired up with more locales, we should be able to catch more of these bugs.
That wouldn't even catch this bug. We need to do that and also format dates covering all patterns (all year styles and time precisions). |
The text was updated successfully, but these errors were encountered: