Relative Content

Tag Archive for kotlin

Trouble Calling an Extension Function from an Interface in a Delegated Class in Kotlin

I have an interface ILoginExt with an extension function Login.logout(). This interface is implemented by the class LoginExt, and another class Login delegates ILoginExt to LoginExt. While I can call the logout extension function within the Login class, trying to call it from an instance of Login in the main function results in an “Unresolved reference: logout” error.

How to limit mathods in class to only overrides

I am implementing Page Object Model for mobile application automation framework. For readability for each page I want to have 2 classes – Page itself having properties and basic functions only and Steps to have all other methods.
I want to create abstract class with some abstract methods and then force all classes that inherit from this class to have implementation only for these needed overridden methods, no more.