1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed method override in generic extensions

This commit is contained in:
Brian Fiete 2022-06-27 17:18:03 -07:00
parent 390275b7f3
commit f2b177693d
2 changed files with 13 additions and 1 deletions

View file

@ -24355,7 +24355,7 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
auto checkMethodInstance = typeInstance->mMethodInstanceGroups[checkMethod->mIdx].mDefault;
if (checkMethodInstance == NULL)
{
if ((methodDef->mIsNew) && (methodDef->mDeclaringType->IsExtension()) && (!checkMethod->mDeclaringType->IsExtension()))
if ((methodDef->mDeclaringType->IsExtension()) && (!checkMethod->mDeclaringType->IsExtension()))
checkMethodInstance = GetRawMethodInstanceAtIdx(typeInstance, checkMethod->mIdx);
if (checkMethodInstance == NULL)
continue;

View file

@ -267,6 +267,18 @@ namespace Tests
}
}
struct TestExtern<T>
{
public extern void MethodA();
}
extension TestExtern<T> where T : Char8
{
public override void MethodA()
{
}
}
[Test]
public static void TestBasics()
{