OutOfBoundsException when getting Constructor params via Introspection

I have this code to find the zero-param Constructor of a class:

Private Function GetZeroParamConstructor(ti As Xojo.Introspection.TypeInfo) As Xojo.Introspection.ConstructorInfo
  dim constructors() as Xojo.Introspection.ConstructorInfo = ti.Constructors
  for i as integer = constructors.Ubound downto 0
    dim c as Xojo.Introspection.ConstructorInfo = constructors( i )
    dim params() as Xojo.Introspection.ParameterInfo = c.Parameters // OutOfBoundsException
    if params.Ubound = -1 then
      return c
    end if
  next i
  return nil
End Function

If the class in question doesn’t define a Constructor, I get the exception indicated when I try to get the parameters. If I do define a Constructor, there is no exception.

Am I missing something?


Yeah, definitely a bug.

OK, will file Feedback with a project soon.



Norman-on-the-spot. Thank you sir.