From a1dc3358a58808a697b621f7a234c05d4fb13574 Mon Sep 17 00:00:00 2001 From: Samah Date: Wed, 5 Aug 2015 14:42:42 +0930 Subject: [PATCH] Allows inherited methods to satisfy interface requirements. --- modules/trans/decl.monkey | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/trans/decl.monkey b/modules/trans/decl.monkey index bf57ec12..28cf8faa 100644 --- a/modules/trans/decl.monkey +++ b/modules/trans/decl.monkey @@ -1234,14 +1234,19 @@ Class ClassDecl Extends ScopeDecl For Local iface:=Eachin implmentsAll For Local decl:=Eachin iface.SemantedMethods() Local found - For Local decl2:=Eachin SemantedMethods( decl.ident ) - If decl.EqualsFunc( decl2 ) - If decl2.munged - Err "Extern methods cannot be used to implement interface methods." + Local cdecl:=Self + While cdecl And Not found + For Local decl2:=Eachin cdecl.SemantedMethods( decl.ident ) + If decl.EqualsFunc( decl2 ) + If decl2.munged + Err "Extern methods cannot be used to implement interface methods." + Endif + found=True Endif - found=True - Endif - Next + Next + cdecl=cdecl.superClass + Wend + If Not found Err decl.ToString()+" must be implemented by class "+ToString() Endif