1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

GetActiveTypeDef mixin issue in GetActiveTypeGenericParamInstances

This commit is contained in:
Brian Fiete 2025-01-31 07:34:06 -08:00
parent e064020c06
commit 2f7616cd40
2 changed files with 36 additions and 1 deletions

View file

@ -9629,7 +9629,9 @@ void BfModule::GetActiveTypeGenericParamInstances(SizedArray<BfGenericParamInsta
if (genericTypeInst->mGenericTypeInfo->mGenericExtensionInfo != NULL)
{
auto activeTypeDef = GetActiveTypeDef(NULL, true);
// Note: original version had useMixinDecl set. Was there a reason for that? Causes issue 2118
auto activeTypeDef = GetActiveTypeDef(NULL);
if ((activeTypeDef->mTypeDeclaration != genericTypeInst->mTypeDef->mTypeDeclaration) && (activeTypeDef->IsExtension()))
{
BfTypeDef* lookupTypeDef = activeTypeDef;

View file

@ -124,6 +124,37 @@ namespace Tests
}
}
class Foo<T, T2> where T : class
{
static void Test ()
{
Helper<T>.Pop!<int>();
}
}
extension Foo<T, T2>
{
}
class Helper<T>
{
}
extension Helper<T>
{
static public mixin Pop<TVal> ()
{
Pop2<int>()
}
static public T Pop2<TVal> () where TVal : var, struct, INumeric
{
return default;
}
}
[Test]
public static void TestBasics()
{
@ -198,6 +229,8 @@ namespace Tests
var sv2 = Unwrap!(svRes)..Trim();
Test.Assert(svRes.Value == "ab ");
Test.Assert(sv2 == "ab");
Helper<int>.Pop!<float>();
}
}