Prechádzať zdrojové kódy

Merge pull request #1731 from disarray2077/patch-4

Fix IsSubtypeOf with TypedPrimitive parameter
Brian Fiete 3 rokov pred
rodič
commit
cf9aa7012c
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      BeefLibs/corlib/src/Type.bf

+ 1 - 1
BeefLibs/corlib/src/Type.bf

@@ -630,7 +630,7 @@ namespace System
 
 
         public virtual bool IsSubtypeOf(Type type)
         public virtual bool IsSubtypeOf(Type type)
         {
         {
-            return type == this;
+            return type == this || (type.IsTypedPrimitive && type.UnderlyingType == this);
         }
         }
 
 
 		public virtual Result<FieldInfo> GetField(String fieldName)
 		public virtual Result<FieldInfo> GetField(String fieldName)