Skip to content

Commit

Permalink
playground file added where I can feel out new syntax (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeebe4code committed May 22, 2024
1 parent 29e6181 commit 21134f3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions playground.ty
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const Car = struct { wheels: u8 = 7 }

type Named = prop { name: [char] }
type Car: Named = struct { wheels: u8 }

type Movable: Named = trait {
fn set_wheels(self, wheels: u8) {
if (self.name == "Sparrow") {
assert(wheels == 3)
}

self.wheels = wheels
}
}

type Wheeled = prop { wheels: usize }

type CarBase: Wheeled + Named = alias

0 comments on commit 21134f3

Please sign in to comment.