This commit is contained in:
nub31
2025-09-08 17:33:13 +02:00
parent 13ed08bb02
commit 7caeecc9a0
3 changed files with 95 additions and 99 deletions

View File

@@ -1,19 +1,30 @@
// c
extern func puts(text: cstring)
struct Human {
interface Printable
{
func print()
}
struct Human : Printable
{
name: cstring
age: u32
func print()
{
puts(this.name)
}
}
func main(args: []cstring): i64
{
let x: Human = struct {
let x: Printable = struct Human {
name = "Oliver"
age = 23
}
puts(x.name)
x.print()
return 0
}