#KT-5362 Fixed #KT-8814 Fixed
Also the diagnostic error message reported the wrong nested class name: it should be the nested class in the hierarchy which is static, not the class of the scope where we're checking the accessibility