Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Data with staticConstructor="..." and generic parameter does not compile with javac #478

Closed
lombokissues opened this issue Jul 14, 2015 · 4 comments

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 405)

@lombokissues
Copy link
Author

👤 brinkmann.michael   🕗 Aug 04, 2012 at 19:44 UTC

What steps will reproduce the problem?

  1. A generic interface:

public interface Interface<T> {}

  1. This class having a member of the above interface:

import lombok.Data;

@ Data(staticConstructor = "of")
public class ClassNotOk<T> {
private final Interface<T> member;
}

What is the expected output?
Should compile ok with javac (like in eclipse)

What do you see instead?

With javac 1.6.0_33, I get the following error:
error: cannot find symbol
symbol : constructor ClassNotOk(Interface<T>)
location: class ClassNotOk<T>

With javac 1.7.0_04, I get the following error:

error: constructor ClassNotOk in class ClassNotOk<T﹟2> cannot be applied to given types;
required: Interface<T﹟1>
found: Interface<T﹟2>
reason: actual argument Interface<T﹟2> cannot be converted to Interface<T﹟1> by method invocation conversion
where T﹟1,T﹟2 are type-variables:
T﹟1 extends Object declared in method <T﹟1>of(Interface<T﹟2>)
T﹟2 extends Object declared in class ClassNotOk

What version of the product are you using? On what operating system?
lombok 0.11.2
OS: Windows 7 (Home Premium)

Please provide any additional information below.

This handcoded class does compile ok (eclipse AND javac):

import lombok.AccessLevel;
import lombok.Data;
import lombok.RequiredArgsConstructor;

@ Data
@ RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class ClassOk<T> {
private final Interface<T> member;

public static <T> ClassOk<T> of(final Interface<T> value) {
return new ClassOk<T>(value);
}
}

@lombokissues
Copy link
Author

👤 reinierz   🕗 Aug 12, 2012 at 22:36 UTC

@lombokissues
Copy link
Author

👤 reinierz   🕗 Aug 12, 2012 at 22:36 UTC

Duplicate of issue #469

@lombokissues
Copy link
Author

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant