Type-inference and the dot operator

There’s a number of things that come into play here. The biggest is that in simple cases, the getproperty call will be inlined and turned into a simple getfield (when there isn’t a getproperty override for the type). Since the symbol is also const it will be possible for constant prop/semi-concrete eval to figure out what’s happening. That said, with sufficiently complex getproperty overloads it is very possible to make foo.bar uninferrable.

3 Likes