Reflecting multiple constructors

About Monkey 2 Forums Monkey 2 Programming Help Reflecting multiple constructors

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Ethernaut 1 year, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11095

    Ethernaut
    Participant

    Is there a way to make reflection work with classes that have multiple overloaded constructors?
    I can make sure my own classes work fine, but I’m running into trouble with Mojo’s classes.

    #11097

    Mark Sibly
    Keymaster

    You need to use the version of GetDecl with the extra ‘type’ parameter – GetDecl with just the name param returns null if there are multiple decls with the same name.

    Also, for ctors the function type you pass to GetDecl should have a Void return type. Something like this…

    #11103

    Ethernaut
    Participant

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.