Skip to content

HList.cons() static factory method doesn't infer tail type #2

Open
@jnape

Description

@jnape

HList.cons should be parametrized to take advantage of Generalized Target Type Inference, making the following expression infer the resulting HList type from right-hand argument:

SingletonHList<Integer> cons = HList.cons(1, HList.nil());
Tuple2<String, Integer> cons = HList.cons("foo", HList.cons(1, HList.nil()));
// ... and so on for other tuple specializations

Unfortunately, after adding this behavior, compile time was observed to have exponentially increased to over 15 seconds thanks to JDK-8055984, so this behavior shouldn't be added back until it's fixed (targeted for Java 1.9).

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