Faction Test v1.0.1.0
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Barotrauma
|
||||
return cachedNonAbstractTypes[assembly].Where(t => t.IsSubclassOf(typeof(T)));
|
||||
}
|
||||
|
||||
public static Option<TBase> ParseDerived<TBase, TInput>(TInput input) where TInput : notnull
|
||||
public static Option<TBase> ParseDerived<TBase, TInput>(TInput input) where TInput : notnull where TBase : notnull
|
||||
{
|
||||
static Option<TBase> none() => Option<TBase>.None();
|
||||
|
||||
@@ -54,10 +54,10 @@ namespace Barotrauma
|
||||
f.Method.GetGenericMethodDefinition().MakeGenericMethod(genericArgs);
|
||||
|
||||
return constructedConverter.Invoke(null, new[] { parseFunc.Invoke(null, new object[] { input }) })
|
||||
as Option<TBase> ?? none();
|
||||
as Option<TBase>? ?? none();
|
||||
}
|
||||
|
||||
return derivedTypes.Select(parseOfType).FirstOrDefault(t => t.IsSome()) ?? none();
|
||||
return derivedTypes.Select(parseOfType).FirstOrDefault(t => t.IsSome());
|
||||
}
|
||||
|
||||
public static string NameWithGenerics(this Type t)
|
||||
|
||||
Reference in New Issue
Block a user