BUG: getting the element type of enumerable types

Forums 💬 NodeCanvas ⚙️ Support BUG: getting the element type of enumerable types

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18223
    bcristian
    Participant

      Hello
      There are several cases where the code tries to determine the type of elements in a enumerable type.
      However, it only checks if the type is an array, or it tries to get the first generic argument. Sometimes it doesn’t even check for the possibility of an array.
      This is not sufficient, as all the following are valid enumerable types. Also, the check should be done against the lowest denominator, Enumerable<T>.

      I’ve added the following in ReflectionTools.cs (for lack of a better idea of where to put it)

      and used it in all the places I could find that used the incomplete method:

      EditorUtils_GUIEditors.cs:52
      UserTypePrefs.cs:181
      Iterator.cs:111

      NOTE: the same thing should be done for dictionaries.

      #18224
      Gavalakis
      Keymaster

        Thanks a lot for pointing this out as well as for the code.
        I will run through the source and see where it needs to be fixed.

        Thanks again.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.