Michael2109 / cobalt

The Cobalt programming language
GNU Lesser General Public License v3.0
37 stars 10 forks source link

Compound data type #509

Open mlutze opened 6 years ago

mlutze commented 6 years ago

We don't currently support the compound data type that can be found in Java:

List<T extends Canine & Domesticated> petDogs = new ArrayList<>();

We may want to consider adding support for this sort of declaration.

Michael2109 commented 6 years ago

This should be added as a type and be parsed with the type parser.

Our syntax could be like this.

let x: List[T extends Canine] = new ArrayList[]()

I haven't seen or used the & part before. We can add that too if required but I need to look into it more.