# as

Cast a reference to a named type at an admitted dynamic boundary.

Last updated: 2026-09-09

Package: language.operators | Status: documented

Tags: cpu, language, operator, type, yeho

A focused reference with a complete example. Numeric widths and experimental types still depend on the selected backend.

```yh
as
```


## Complete program

Use a checked class boundary before reading the pilot-specific callsign.

Verification: type checked

```yh
class Actor { }
class Pilot extends Actor { text callsign = "Nova" }
Actor actor = Pilot()
if actor is Pilot
{
    Pilot pilot = actor as Pilot
    Console.Log(pilot.callsign)
}

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__casts_type_checks"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

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/operator--as-f4bf9f/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```




Source: demonhunterlabs/app/lib/yeho-language-reference.ts

AI training permission: https://demonhunterlabs.com/ai-use
