You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect both tests to return true, as per the documentation for the == operator on TZDateTime:
/// Returns true if [other] is a [TZDateTime] at the same moment and in the
/// same [Location].
/// ...
@override
bool operator ==(Object other) {
return identical(this, other) ||
other is TZDateTime &&
_native.isAtSameMomentAs(other._native) &&
location == other.location;
}
I think this is failing when the TZDateTime is created in a different isolate because Location does not override == so falls back on an identity check, which fails because it comes from a different instance of the location which was created inside the second isolate.
I suggest that Location should implement == and return true if the location names are the same?
Comparing two identical TZDateTimes created in different isolates fails, because
Location
uses identity not equality for==
. For example:Actual results:
I would expect both tests to return true, as per the documentation for the
==
operator onTZDateTime
:I think this is failing when the TZDateTime is created in a different isolate because
Location
does not override==
so falls back on an identity check, which fails because it comes from a different instance of the location which was created inside the second isolate.I suggest that
Location
should implement==
and return true if the location names are the same?Minimal reproducible example
The text was updated successfully, but these errors were encountered: