Translation error

Monkey Forums/Monkey Bug Reports/Translation error

AntonM(Posted 2012) [#1]
Hi,
I have duplicate method name after translation this code

Import mojo

Class Game Extends App
	Field f:Font
	
	Method OnRender()
		Draw()
		f.Draw("",0,0)
		f.Draw2("",0,0)
	End
	
	Method Draw()
	End
End

Class Font
	Method Draw(text:String, x:Int, y:Int)
	End
	
	Method Draw2(text:String, x:Int, y:Int)
	End
End

Function Main:Int()
	New Game
	Return 0
End


This result on ios target

class bb_main_Font : public Object{
	public:
	bb_main_Font();
	virtual int m_Draw2(String,int,int);
	virtual int m_Draw2(String,int,int);
	void mark();
};



Goodlookinguy(Posted 2012) [#2]
Monkey adds numbers after method names as a means to handle method overloading and overwriting in programming languages that don't support those. So the output isn't so much wrong as it is you just shouldn't use numbers at the end of method names.


marksibly(Posted 2012) [#3]
Hi,

That's a bug! Will fix.


Goodlookinguy(Posted 2012) [#4]
This has been a bug the whole time? I just figured you were forcing better naming conventions in a way.

@AntonM
Nevermind my comment.