Are there plans to introduce a compiler intrinsic ...
# announcements
s
Are there plans to introduce a compiler intrinsic to get a list of supertypes of a reified type T, similar to the new
typeOf
?
k
That would only work within a compilation unit, because only then all occurrences of a method call would be known to the compiler. But as soon as someone calls that method from a different module, the derived supertype might not longer apply. If you want to narrow the supertype in a reified method, you can do so by simply narrowing the generic type:
<reified T: Number>
☝️ 1