···143143 throw new ArgumentNullException(nameof(instance));
144144 }
145145146146- info = info.WithType(Nullable.GetUnderlyingType(type) ?? type);
146146+ info = info.WithType(type.GetUnderlyingNullableType() ?? type);
147147148148 var instanceType = instance.GetType();
149149- instanceType = Nullable.GetUnderlyingType(instanceType) ?? instanceType;
149149+ instanceType = instanceType.GetUnderlyingNullableType() ?? instanceType;
150150151151 if (instanceType.IsValueType && !allowValueTypes)
152152 throw new ArgumentException($"{instanceType.ReadableName()} must be a class to be cached as a dependency.", nameof(instance));
···167167168168 public object Get(Type type, CacheInfo info)
169169 {
170170- info = info.WithType(Nullable.GetUnderlyingType(type) ?? type);
170170+ info = info.WithType(type.GetUnderlyingNullableType() ?? type);
171171172172 if (cache.TryGetValue(info, out var existing))
173173 return existing;
+2-1
osu.Framework/Bindables/Bindable.cs
···88using JetBrains.Annotations;
99using Newtonsoft.Json;
1010using osu.Framework.Caching;
1111+using osu.Framework.Extensions.TypeExtensions;
1112using osu.Framework.IO.Serialization;
1213using osu.Framework.Lists;
1314···237238 /// <param name="input">The input which is to be parsed.</param>
238239 public virtual void Parse(object input)
239240 {
240240- Type underlyingType = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T);
241241+ Type underlyingType = typeof(T).GetUnderlyingNullableType() ?? typeof(T);
241242242243 switch (input)
243244 {