buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.22k stars 34 forks source link

Protocol generics #212

Open giann opened 11 months ago

giann commented 11 months ago
protocol Countable::<T> {
    fun add(T value) > void;
}

object Item{}

object(Countable::<Item>) Person {
    [Item] items,

    fun add(Item value) > void {
        this.items.append(value);
    }
}