Typecast not possible from Own Subrangetypes?


(SH) #1

Hey guys,

i want to know, why isnt it possible to cast an enum value, for instance, a value of enum of Capacity to Capacity:

have a look:

Capacity = 20..Int64.MaxValue;
MyEnum = public enum(a = 20, b = 40, c = 60) of Capacity;

var capacity := Capacity(MyEnum.a);   //Throws a type missmatch

Is that enough or do you Need again a Project?


(RemObjects) #2

Thanks, logged as bugs://77635

(Carlo Kok) #3

Good enough. In the mean time, it probably works if you cast to int64 in between.

(SH) #4

Yes i did that, but would be much better when this got fixed :smiley:

(SH) #5

is it possible, that this typecast can be made in the next beta build?

(Carlo Kok) #6

No. This particular change won’t make it for the current release target.

(RemObjects) #7

bugs://77635 got closed with status fixed.