mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Work around broken nullability.
Revert "Fix nullability errors" This reverts commita7f31f9ebf. Revert "NotNullWhen()" This reverts commitb332644d48. Work around broken nullability.
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Robust.Shared.GameObjects.Components.Localization
|
||||
if (serializer.TryReadDataFieldCached("gender", out string? gender0))
|
||||
{
|
||||
var refl = IoCManager.Resolve<IReflectionManager>();
|
||||
if (refl.TryParseEnumReference(gender0, out var gender))
|
||||
if (refl.TryParseEnumReference(gender0!, out var gender))
|
||||
{
|
||||
Gender = (Gender)gender;
|
||||
}
|
||||
|
||||
@@ -298,18 +298,18 @@ namespace Robust.Shared.Serialization
|
||||
return TryReadDataField(name, WithFormat<T>.NoFormat, out value);
|
||||
}
|
||||
|
||||
public abstract bool TryReadDataField<T>(string name, WithFormat<T> format, [NotNullWhen(true)] out T value);
|
||||
public abstract bool TryReadDataField<T>(string name, WithFormat<T> format, [MaybeNullWhen(false)] out T value);
|
||||
|
||||
/// <summary>
|
||||
/// Try- pattern version of <see cref="ReadDataFieldCached" />.
|
||||
/// </summary>
|
||||
public virtual bool TryReadDataFieldCached<T>(string name, [NotNullWhen(true)] out T? value)
|
||||
public virtual bool TryReadDataFieldCached<T>(string name, [MaybeNullWhen(false)] out T value)
|
||||
{
|
||||
return TryReadDataFieldCached(name, WithFormat<T>.NoFormat, out value);
|
||||
}
|
||||
|
||||
public virtual bool TryReadDataFieldCached<T>(string name, WithFormat<T> format,
|
||||
[NotNullWhen(true)] out T value)
|
||||
[MaybeNullWhen(false)] out T value)
|
||||
{
|
||||
return TryReadDataField(name, format, out value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user