danielcirket / language

Apache License 2.0
0 stars 0 forks source link

Feature: Generic Constraints #19

Open danielcirket opened 7 years ago

danielcirket commented 7 years ago

Much like in C# etc, where you can do things like this:

public void DoSomething<T>(T value) where T : SomeType

Or typescript where the syntax is something like this:

public DoSomething<T extends SomeType>(T value): void

I also want to be able to constrain to enum types, which you can't do in C#:

public void DoSomething<T>(T value) where T : enum