Alias usage

Monkey Forums/Monkey Bug Reports/Alias usage

Belimoth(Posted 2012) [#1]
Is it intended that you should be able to Alias a function to a function within a class? Like this:
'myfile.monkey
Class MyNamespace
	Function SetColor:Int(r:Int, g:Int, b:Int)
...
'main.monkey
Alias SetColor=myfile.MyNamespace.SetColor

I did it and it compiles without any errors, but the function never gets called.

This workaround works, but I am just curious.
'myfile.monkey
Class MyNamespace
	Function SetColor:Int(r:Int, g:Int, b:Int)
...
Function MySetColor:Int(r:Int, g:Int, b:Int)
	MyNamespace.SetColor(r, g, b)
...
'main.monkey
Alias SetColor=myfile.MySetColor



Halfdan(Posted 2012) [#2]
It would be logical if the first method works, but if if doesn't it should at least throw an error when calling the alias


DruggedBunny(Posted 2012) [#3]
I'd have expected that to work, but as minke says, it probably should throw an error if it's not meant to work -- moving thread to Bug Reports!