SamPerson
SamPerson
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
Is this a compiler bug or related to some intended behavior?
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
This gets recieved as a System.Action, it just adds a completley unnecessary level of indirection I feel mildly insane
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
No description
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
wh
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
Same deal Is there something specific you wanted to check by getting DrawSprite from relfection?
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
No description
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
No description
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
Ahh, will do
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
Not quite sure what you mean or what that would do?
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
// exception
result.DrawSprite = (System.Action<System.String, System.Single, System.Single, System.Single, System.Single, System.Single, System.Single>)drawSpriteFn;

// no exception
result.DrawLODSprite = (System.Action<System.String, System.Single, System.Single, System.Single>)lodSpriteFn;
// exception
result.DrawSprite = (System.Action<System.String, System.Single, System.Single, System.Single, System.Single, System.Single, System.Single>)drawSpriteFn;

// no exception
result.DrawLODSprite = (System.Action<System.String, System.Single, System.Single, System.Single>)lodSpriteFn;
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
The parameters are identical
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
I get an exception that I can't convert it -
InvalidCastException: Unable to cast object of type

'<>f__AnonymousDelegate0`7[System.String,System.Single,System.Single,System.Single,System.Single,System.Single,System.Single]' to type
'System.Action`7 [System.String,System.Single,System.Single,System.Single,System.Single,System.Single,System.Single]'.
InvalidCastException: Unable to cast object of type

'<>f__AnonymousDelegate0`7[System.String,System.Single,System.Single,System.Single,System.Single,System.Single,System.Single]' to type
'System.Action`7 [System.String,System.Single,System.Single,System.Single,System.Single,System.Single,System.Single]'.
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
No description
26 replies
CC#
Created by SamPerson on 10/17/2024 in #help
Named function magically turns into anonymous method for no clear reason, cannot be used as Action
No description
26 replies