Skip to content

Support type parameter constraints #107

@lptr

Description

@lptr

Both Haxe and TypeScript have support for type parameter constraints.

Haxe has a bit more support, because you can extend multiple types:

class Something<T:(Iterable<String>, Measureable)>

In TypeScript you can only extend a single type:

interface G<T, U extends Function>

None of these languages support Java's super constraints:

List<? super Integer>

Spaghetti could support TypeScript-style single-type extends, and leave the more esoteric stuff out.

Syntax could be based on TypeScript/Java:

<T extends Iterable<String>, X extends T>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions