Why does NameOf(foo.First.Bar) works but NameOf(foo[0].Bar) doesn't?

83 views Asked by At

When I try to run NameOf(foo[0].Bar) I get "This sub-expression cannot be used inside NameOf argument" error, which makes total sense to me.

But when I run NameOf(foo.First.Bar) it works and returns "Bar".

While this seems intuitively ok, what's the proper explanation for this behaviour?

0

There are 0 answers