Inspectopedia
 
2024.3

Invalid call to protected/private method

Warning
New
Last modified: 03 December 2024

Reports invalid calls to protected/private methods.

You can call a protected method using an implicit or explicit receiver of the correct type.

You can call a private method only with an implicit receiver (except for self setter methods, for example, self.foo=).

You can call both protected and private methods only from the context of a method handler.