瀏覽代碼

Add Mixin methog flag

zkw 1 年之前
父節點
當前提交
0d680ca5c2

+ 3 - 0
BeefLibs/corlib/src/Reflection/MethodInfo.bf

@@ -56,6 +56,9 @@ namespace System.Reflection
 		public bool CanReflect => Compiler.IsComptime ?
 		public bool CanReflect => Compiler.IsComptime ?
 			Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mComptimeMethodFlags.HasFlag(.NoReflect) :
 			Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mComptimeMethodFlags.HasFlag(.NoReflect) :
 			mData.mMethodData.[Friend]mFlags.HasFlag(.SpecialName);
 			mData.mMethodData.[Friend]mFlags.HasFlag(.SpecialName);
+		public bool IsMixin => Compiler.IsComptime ?
+			Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mMethodFlags.HasFlag(.Mixin) :
+			mData.mMethodData.[Friend]mFlags.HasFlag(.Mixin);
 
 
 		public StringView Name => Compiler.IsComptime ?
 		public StringView Name => Compiler.IsComptime ?
 			Type.[Friend]Comptime_Method_GetName(mData.mComptimeMethodInstance) :
 			Type.[Friend]Comptime_Method_GetName(mData.mComptimeMethodInstance) :

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

@@ -1533,6 +1533,7 @@ namespace System.Reflection
 		Virtual             	= 0x0040,     // Method virtual.
 		Virtual             	= 0x0040,     // Method virtual.
 		HideBySig           	= 0x0080,     // Method hides by name+sig, else just by name.
 		HideBySig           	= 0x0080,     // Method hides by name+sig, else just by name.
 		ReadOnly				= 0x0100,
 		ReadOnly				= 0x0100,
+		Mixin                   = 0x0200,
 		Abstract            	= 0x0400,     // Method does not provide an implementation.
 		Abstract            	= 0x0400,     // Method does not provide an implementation.
 		SpecialName         	= 0x0800,     // Method is special.  Name describes how.
 		SpecialName         	= 0x0800,     // Method is special.  Name describes how.
 		StdCall					= 0x1000,
 		StdCall					= 0x1000,

+ 2 - 0
IDEHelper/Compiler/BfResolvedTypeUtils.cpp

@@ -830,6 +830,8 @@ BfMethodFlags BfMethodInstance::GetMethodFlags()
 		methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Constructor);
 		methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Constructor);
 	if (mMethodDef->mIsReadOnly)
 	if (mMethodDef->mIsReadOnly)
 		methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_ReadOnly);
 		methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_ReadOnly);
+	if (mMethodDef->mMethodType == BfMethodType_Mixin)
+		methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_Mixin);
 
 
 	auto callingConvention = GetOwner()->mModule->GetIRCallingConvention(this);
 	auto callingConvention = GetOwner()->mModule->GetIRCallingConvention(this);
 	if (callingConvention == BfIRCallingConv_ThisCall)
 	if (callingConvention == BfIRCallingConv_ThisCall)

+ 1 - 0
IDEHelper/Compiler/BfSystem.h

@@ -240,6 +240,7 @@ enum BfMethodFlags
 	BfMethodFlags_Static = 0x10,
 	BfMethodFlags_Static = 0x10,
 	BfMethodFlags_Virtual = 0x40,
 	BfMethodFlags_Virtual = 0x40,
 	BfMethodFlags_ReadOnly = 0x100,
 	BfMethodFlags_ReadOnly = 0x100,
+	BfMethodFlags_Mixin = 0x200,
 	BfMethodFlags_StdCall = 0x1000,
 	BfMethodFlags_StdCall = 0x1000,
 	BfMethodFlags_FastCall = 0x2000,
 	BfMethodFlags_FastCall = 0x2000,
 	BfMethodFlags_ThisCall = 0x3000,
 	BfMethodFlags_ThisCall = 0x3000,