Ooh, I'm not sure. Basically having an enum type for the properties of the object?
I guess that could probably work. Most languages I've seen with static typing don't have a syntax for accessing a struct field with a variable, rather than the literal field name, but I'd like to see one that does.
I agree, this ain't a normal types thing, but I think it can be done (Rust? C++?) and I will probably waste time on this.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.