|
get => _tags?.Enumerate() ?? Unsafe.As<IEnumerable<KeyValuePair<string, object?>>>(s_emptyBaggageTags); |
is invalid use of
Unsafe.As.
Unsafe.As cannot be used to cast object to a type that it is not assignable to and then hand the reference of invalid type out.
Please do not use Unsafe.As unless it is really required. Having an extra static field of the right type is both more correct and also likely cheaper than Unsafe.As.