scope

open override var scope: Scope?

The Scope associated with this node. Only used by (and set by) the code generator, so it is always null in frontend AST-processing code. Use definingScope to find the lexical scope in which this name is defined.

Setting it does not touch any field in the scope. Not every name has one: typically only function and variable names, not property names, are registered in a scope.