sviperll / adt4j

adt4j - Algebraic Data Types for Java
BSD 3-Clause "New" or "Revised" License
143 stars 8 forks source link

Usage of varargs generates non-varargs constructor #8

Closed talios closed 9 years ago

talios commented 9 years ago

Here's an interesting one I just hit, when using varargs in a ADT method:

R composite(String name, S... fields);

The constructor method is generated as:

R composite(String name, S[] fields);

There is the question around if modelling this particular use case with varargs is good/bad, but I think the generated code should match at least.

sviperll commented 9 years ago

I agree that generated code should match declaration. I'll look into it. Thanks for feedback.

sviperll commented 9 years ago

Should work in master now:

https://github.com/sviperll/adt4j/commit/0a79e3028c0a4bb5edd98e8df5a130cd0025cb0e