# extends

Name a base class

Last updated: 2026-09-09

Package: language | Status: generated-cpp-only

Tags: complete-program, cpu, data, keyword, yeho

Prefer thing and ordinary functions for Kyber-ready programs. Use class and interface only while evaluating the explicit oracle route.

```yh
extends
```


## Object dispatch abi

Prefer thing and ordinary functions for Kyber-ready programs. Use class and interface only while evaluating the explicit oracle route.

Verification: type checked

```yh
interface scorer
{
    Score() returns int
}

class baseScore implements scorer
{
    Score() returns int
    {
        return 3
    }
}

class derivedScore extends baseScore
{
    override Score() returns int
    {
        return 9
    }
}

derivedScore item = derivedScore()
baseScore baseView = item
scorer interfaceView = item

if baseView.Score() == 9 and interfaceView.Score() == 9
{
    Console.Log("object-dispatch-abi-ok")
}

```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.kyber.objectDispatchAbi"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/word--extends/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Class and interface dispatch is generated-C++ only in Yeho Core 2026.1.

Generic classes and interfaces are not admitted even though the parser reserves research syntax.

Source: yeho/docs/language/conformance-2026.1.json: class-and-interface-dispatch; parser_declarations.cpp

AI training permission: https://demonhunterlabs.com/ai-use
