Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object -- Unary 1; the root trait, very first one created; 1 is its "tag"
- Foo = Object clone -- Union (Unary 2) (Unary 1) (@clone might become @derive or something)
- Bar = Foo clone -- Union (Unary 3) (Union (Unary 2) (Unary 1))
- Fizz = Foo clone -- Union (Unary 4) (Union (Unary 2) (Unary 1))
- -- defines on trait:
- -- Intersection (Unary 2) (Unary 3)
- -- note that the unions are gone; it only intersects on the "heads"
- (f: Foo) x: (b: Bar) := 1
- -- searches for trait:
- -- Intersection (Union (Unary 2) (Unary 1)) (Union (Unary 3) (Union (Unary 2) (Unary 1)))
- -- ie, any trait in unions can match
- Foo x: Bar
- => 1
- -- also finds @x: because Unary 2 is in Fizz's union
- -- Bar x: Bar would work too
- Fizz x: Bar
- => 1
Add Comment
Please, Sign In to add comment