Int32 cast don't compile in 64-bit debug

... Int32(someEnum)

Don’t compile in 64-bit debug (macOS 10.12.1, Xojo2017r2) can replace with:

... CType(someEnum, Int32)

The problem is there are hundreds of entries in my projects so, the workaround was: regex search/replace:

Pattern search: (Int32)\((([\w*\.]*)+)
replace with: Ctype(\2, Int32

<https://xojo.com/issue/49184>

not a bug

enums are based on Integers - not Int32
so your code was literally written to ONLY work for 32 bit apps because you cast to int32 instead of integer

this

Dim someInteger As Integer= Int32(SomeType.Default)

should have been

Dim someInteger As Integer= Integer(SomeType.Default)

and then you can assign the result to an int32 or integer

[quote=345821:@Norman Palardy]not a bug

enums are based on Integers - not Int32
so your code was literally written to ONLY work for 32 bit apps because you cast to int32 instead of integer
…[/quote]

I use Int32(…) because the documentation says do that. The new documentation change to Integer(…), So I think is a bug, compile in 32-bit and not in 64-bit by a recommendation of xojo.

Thats why the docs were updated
Your code is wrong

A cast is literally “take this thing and all its bits and treat it as if its the type we’re casting to”
But you have a 64 bit integer you’re saying you want to treat as a int32
That doesn’t work
The type you’re casting TO has to be the same number of bits
And in your code it isn’t

The right update to make things work in 32 or 64 bit is what I posted

That still doesn’t make this a bug

[quote=345899:@Norman Palardy]Thats why the docs were updated
Your code is wrong
…[/quote]

Yes, my code is wrong, because the documentation for several years says that, not me. the solution is change “Int32(” by “Integer(”.

But you have right, is not a bug,