mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
[Feature Request] User-defined generics (type parameters for classes) #160
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @moritztim on GitHub (May 15, 2024).
But why?
@bioball commented on GitHub (Jun 10, 2024):
Generics add a lot of complexity to the language, and is hard to get right. This is something we would like to add to the language at some point, but I would say that we're not close yet.
For example, one thing to consider is how to implement variance checking. Today, Pkl does not perform subtype checking, and this is not trivial because of type constraints.
We also have some bugs with type parameters in the core language that will need to be fixed before we can start to consider something like this.
@joshqou commented on GitHub (Dec 13, 2025):
Ran into this limitation myself. Definitely would be an appreciated feature