I have a typealias for UInt (`typealias PlanOID = ...
# announcements
t
I have a typealias for UInt (
typealias PlanOID = UInt
). Ideally, I’d like to bind a class/type/static function to PlanOID (e.g.
PlanOID.nowOID()
), but I think this is not possible. I’m assuming that PlanOID is just what it says, a substitution alias, not a distinct type. And since UInt doesn’t have a Companion, I can’t extend that. Is this correct? Am I missing some other trick. I get that I can just define a global free function, but I’d rather bind the behavior to the type if I could (avoids namespace clutter)
w
currently expermental, but sounds like you would be interested in inline classes https://kotlinlang.org/docs/reference/inline-classes.html
☝️ 1
t
And then I can add my own companion. Very interesting, thanks.