I’m having a problem passing enums into a generic method.
The method is:
|
|
[crayon-5cba83dc6b6ed510423666 inline="true" ]Function IsSame:Void(expected:T, actual:T, message:String = "") If expected <> actual Print("Expected instances to be equal. " + message) End End |
[/crayon]
I can call this successfully with a single enum:
IsSame(Direction.None, Direction.None)
but if I try to add a second call with a different enum:
IsSame(AnotherEnum.Value, AnotherEnum.Value)
then it complains that the method has been “previously defined“.
Unfortunately I can’t paste the entire error here as the Ted2 output window doesn’t let me select or copy text, but it’s basically:
redefinition of ‘void g_framework_testing_TestAssert_IsSame_1TbbInt_2(bbInt, bbInt, bbString)’
‘void g_framework_testing_TestAssert_IsSame_1TbbInt_2(bbInt, bbInt, bbString)’ previously defined here void g_framework_testing_TestAssert_IsSame_1TbbInt_2(bbInt l_expected, bbInt l_actual, bbString l_message){