jmiguel
jmiguel

Reputation: 349

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

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?

Upvotes: 0

Views: 104

Answers (0)

Related Questions