ZonedDateTime methods should be infallible
ZonedDateTime has a lot of the same methods as PlainDateTime, like .year(), but they're all fallible because of the provider stuff.
With compiled_data they should definitely not be fallible. We should also consider having these never be fallible, and having the case of "mixing providers" be treated as pure GIGO.
I realized that the constructor does not check the timezone, even though the spec does. Boa does this validation externally, which I guess we can do in v8 as well. But in that case perhaps we should have a separated ValidatedTimeZone type?
I realized that the constructor does not check the timezone, even though the spec does.
The constructor checking the time zone currently is something I'd like to do, but would require baked data. See #306.
See also: https://github.com/boa-dev/temporal/issues/330#issuecomment-2933160973 for a potential principled approach here.
FWIW, I've since moderated my position here: I think it's okay to have these fallible and only ever returning assertion errors.
Having these be infallible-but-GIGO is a potential option, still, but I'm more wary about it: our normalization data and our tzif data do not have the same source; which means they can get out of sync.