mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
GetActiveTypeDef mixin issue in GetActiveTypeGenericParamInstances
This commit is contained in:
parent
e064020c06
commit
2f7616cd40
2 changed files with 36 additions and 1 deletions
|
@ -9629,7 +9629,9 @@ void BfModule::GetActiveTypeGenericParamInstances(SizedArray<BfGenericParamInsta
|
||||||
|
|
||||||
if (genericTypeInst->mGenericTypeInfo->mGenericExtensionInfo != NULL)
|
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()))
|
if ((activeTypeDef->mTypeDeclaration != genericTypeInst->mTypeDef->mTypeDeclaration) && (activeTypeDef->IsExtension()))
|
||||||
{
|
{
|
||||||
BfTypeDef* lookupTypeDef = activeTypeDef;
|
BfTypeDef* lookupTypeDef = activeTypeDef;
|
||||||
|
|
|
@ -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]
|
[Test]
|
||||||
public static void TestBasics()
|
public static void TestBasics()
|
||||||
{
|
{
|
||||||
|
@ -198,6 +229,8 @@ namespace Tests
|
||||||
var sv2 = Unwrap!(svRes)..Trim();
|
var sv2 = Unwrap!(svRes)..Trim();
|
||||||
Test.Assert(svRes.Value == "ab ");
|
Test.Assert(svRes.Value == "ab ");
|
||||||
Test.Assert(sv2 == "ab");
|
Test.Assert(sv2 == "ab");
|
||||||
|
|
||||||
|
Helper<int>.Pop!<float>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue