Introspection Attribute types are now always Text?

In my application, I have a bunch of methods that are invoked with Introspection.MethodInfo.Invoke. These methods also have several attributes assigned, which provide necessary parameters for invoking the method. Some of the attributes are numbers and some are text.

In version 2016r3, if an attribute had a numeric value, then I could retrieve its value and directly assign it to an integer variable. However as of version 2016r4.1, all attributes appear to be type Text. In order to deal with this, and make things compatible with both 2016r3 and 2016r4.1, I have to add a bunch of code to check the data type, and then convert numeric attributes back into numbers. It’s annoying, but I can make it work. However, I wonder if I may be missing something. The attributes are data type Auto, and I assume there must be a reason for this. However, what’s the point of using the Auto data type if everything is converted to Text? Why not just make the attributes type Text (as they seem to be anyway), and be done with it?

You are right. I’d call this a design flaw.

Digging into it a bit deeper, I see that in 2016r3, all attributes were type String, but apparently there must have been an implicit type conversion when assigned to a numeric variable (which doesn’t happen with the text type in 2016r4.1). So, the change between 2016r3 and 2016r4.1 isn’t as big as I initially thought.

I guess this is due to the difference in term of implicit conversion between Variant and Auto. The classic introspection module uses Variant and the new framework Auto. And since AttributeInfo inherits Value from MemberInfo it is of type Auto.

It’s a bug.

Thanks for the clarification. I thought maybe I just misunderstood what was expected behaviour. Is there a bug report number for this?

I’m not aware of any. Could you file one?

I did some checking. It looks as if it’s already been reported. I found this:
<https://xojo.com/issue/46553>