What's causing 'modifier 'override' is not applicable to 'local function' in kotlin?

This error occurs when you try to use the `override` keyword on a function that is not a member of a class or object.

Example:


fun main() {
    override fun show() {}
}

Solution:


open class Base {
    open fun show() {}
}

class Derived : Base() {
    override fun show() {}
}
Only override functions inside a class or object that inherit from another class or interface.

Beginner's Guide to Kotlin