Skip to content

Support existential types #38

@sviperll

Description

@sviperll

Allow definitions like this:

interface SomeVisitor<T, R> {
    <U extends Callable<T> & Serializable> R callable(U callable);
    R immediate(T value);
}

So we can write

int eval(SomeValue<Integer> value) {
    return value.accept(new SomeVisitor<Integer, Integer>() {
        <U extends Callable<Integer> & Serializable> Integer callable(U callable) {
            return callable.call();
        }
        Integer immediate(Integer value) {
            return value;
        }
    });
}

This will pave the way to GADT support #15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions