Using the same function in an extended type
BlitzMax Forums/BlitzMax Programming/Using the same function in an extended type
| ||
When I use the same function from a base type, in an extended type, I get an error about using the same type. I would like to use the same function in the base type but with more parameters for an extended type. For example: Type BaseType Function Create(A:Int) End Function End Type Type ExtendedType Extends BaseType Function Create(A:Int, B:Int) End Function End Type Is it possible to use the same function name within an extended type or do I need to try something different? Thank you. |
| ||
Yes you can use the same function name if it has also the same parameters list. So your example won't work, unless you add also the B parameter in the base type create function. |
| ||
Hello. Is needed two functions have same signature. In your case the first have one parameter and the last have two parameters. The overloading is not legal in blitzmax :( Bye, Paposo |