Inconsistent behaviour with null defaults

Monkey Forums/Monkey Bug Reports/Inconsistent behaviour with null defaults

muddy_shoes(Posted 2013) [#1]
The code below fails on Android due to the production of an ambiguous call when the Null default is used. I'd guess either the null generated needs to be cast to the specific type or the new method needs to be munge-namespaced to the subclass like the C# translator appears to do.

Import mojo

Class Thing
	
End

Class OtherThing
	
End

Class Test
	Field t:Thing
	
	Method New( it:Thing )
		t = it
	End
End

Class TestDescendant Extends Test
	Field ot:OtherThing
	
	Method New( ot:OtherThing = Null )
		Self.ot = ot
	End
End

Function Main:Int()
	Local a:App = New App()
	
	Local td:TestDescendant = New TestDescendant()
	
	Return 0
End



marksibly(Posted 2013) [#2]
Seems to be building OK here on Android...


muddy_shoes(Posted 2013) [#3]
Okay, looks like you changed the code generation at some point since my current version. The output munges the class name into the new method name in 72b and resolves the problem.


marksibly(Posted 2013) [#4]
Whew!