瀏覽代碼

Fixed translator using Base::Method issue.

Mark Sibly 8 年之前
父節點
當前提交
f731ea6881
共有 1 個文件被更改,包括 15 次插入3 次删除
  1. 15 3
      src/mx2cc/translator_cpp.monkey2

+ 15 - 3
src/mx2cc/translator_cpp.monkey2

@@ -443,13 +443,25 @@ Class Translator_CPP Extends Translator
 				
 					If func.IsGeneric Continue
 					
-					If Not func.IsMethod Or func.scope<>ctype.superType.scope Continue
+					If Not func.IsMethod Continue
 					
-					Local sym:=FuncName( func )
+					Local superType:=ctype.superType
+					While superType
+						If func.scope=superType.scope exit
+						superType=superType.superType
+					Wend
+					If Not superType Continue
+						
+				'	If Not func.IsMethod Or func.scope<>ctype.superType.scope Continue
+					
+					Local superName:=ClassName( superType )
+					
+					Local sym:=superName+"::"+FuncName( func )
 					If done[sym] Continue
 					done[sym]=True
 					
-					Emit( "using "+superName+"::"+sym+";" )
+					Emit( "using "+sym+";" )
+'					Emit( "using "+superName+"::"+sym+";" )
 				Next
 			Next
 		Endif