function defaults must be constant

BlitzMax Forums/BlitzMax Programming/function defaults must be constant

thx for the quick replies :) i went ahead with Roberts wrapper method approach using a _impl suffix on the method name to denote the actual implementation of the method. just need to make sure to override the _impl method instead of the wrapper in the cases where its used...
Framework BRL.Blitz

Type t1
	Field val1:Int
	Field val2:Int
	Field val3:Int
	
	Function create:t1()
		Local retval:t1=New t1
		retval.val1=5
		retval.val2=10
		retval.val3=15
		Return retval
	EndFunction
EndType

Type t2
	Method test(v:t1=Null)
		If Not v Then v=t1.create()
		test_impl(v)
	EndMethod

	Method test_impl(v:t1)
		DebugLog(v.val1)
		DebugLog(v.val2)
		DebugLog(v.val3)
	EndMethod
EndType

i suppose another nice feature of doing it this way is that if i needed to, i could actually change what the default type instance is by overriding the wrapper method also.