buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Object generics

Open giann opened this issue 3 years ago • 0 comments

object Population<T> {
    [T] population,

    fun count() > num {
        return this.population.len();
    }
}

Population<str> myPopulation = Population<str>{
    population = [str, "joe", "john", "burt"],
};

myPopulation.count() == 3;

giann avatar Sep 13 '22 14:09 giann