You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Java you can declare that T extends a certain class to ensure the generic type is of that class. E.g. if you have an animal class and a cat class that extends animal, you could make a generic that is Something and now you can use Cat or Animal but not things that aren't Animal extensions for the type of Something.
So... is there equivalent in Haxe for ensuring the T extends something?
@Mimerr you can add constraints to type parameters to specify that they implement or are subclasses of other interfaces/types. For example, the following Java declaration:
Generic - Haxe - The Cross-platform Toolkit
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.
https://haxe.org/manual/type-system-generic.html
The text was updated successfully, but these errors were encountered: