From f2b177693d05ec27d2e9d88cddcfa45dab4d0047 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 27 Jun 2022 17:18:03 -0700 Subject: [PATCH] Fixed method override in generic extensions --- IDEHelper/Compiler/BfModule.cpp | 2 +- IDEHelper/Tests/src/Extensions.bf | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index ed1660a2..a2c45c80 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -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; diff --git a/IDEHelper/Tests/src/Extensions.bf b/IDEHelper/Tests/src/Extensions.bf index 6aef2980..e7ee2d95 100644 --- a/IDEHelper/Tests/src/Extensions.bf +++ b/IDEHelper/Tests/src/Extensions.bf @@ -267,6 +267,18 @@ namespace Tests } } + struct TestExtern + { + public extern void MethodA(); + } + + extension TestExtern where T : Char8 + { + public override void MethodA() + { + } + } + [Test] public static void TestBasics() {