Inside WHLSLNativeFunctionWriter.cpp, we special case "operator.length" which is wrong for automatically generated getters for user-authored fields named "length" inside structs.
<rdar://problem/51002694>
Consider the following: struct Foo { int length; } synthesizeStructureAccessors() will create a getter for that field (just like it would create a getter for any other field) and this new getter will be named "operator.length". It will be a NativeFunctionDeclaration because it's being generated by synthesizeStructureAccessors(). Then, this code will recognize the name, and erroneously treat it as if it was .length on an array reference.
WHLSL is no longer relevant.