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

val assigning incorrect class to Arrays.asList() in Eclipse #1986

Closed
dastamatis opened this issue Dec 17, 2018 · 8 comments
Closed

val assigning incorrect class to Arrays.asList() in Eclipse #1986

dastamatis opened this issue Dec 17, 2018 · 8 comments
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.

Comments

@dastamatis
Copy link

dastamatis commented Dec 17, 2018

In the latest version of lombok and Eclipse, val is incorrectly assigning variable "x" to Object instead of List<Class<? extends java.io.Serializable>> in the code below:

package com.github.rzwitserloot;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import lombok.val;

public class ValBug {
	public static void main(String[] args) throws Exception {
		val x = Arrays.asList(String.class, BigDecimal.class);
		for (val y : x) {
			
		}
	}
}
@dastamatis dastamatis changed the title val assigning incorrect class to Arrays.asList() val assigning incorrect class to Arrays.asList() in Eclipse Dec 17, 2018
@rspilker
Copy link
Collaborator

Is that a regression; did a previous version of lombok do this differently?

Is is only in Eclipse, or also on javac?

@rspilker rspilker added the parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these. label Jan 29, 2019
@dastamatis
Copy link
Author

I tried it with 1.14.6, 1.16.10, 1.16.16, and latest version 1.18.4, both in Eclipse and on the command line.

Error is the same:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from List<Class>> to List<Class<? extends Object>>

@dastamatis
Copy link
Author

And by "on the command line", I mean I compiled it with javac in a terminal window (not from Eclipse's UI).

@rspilker
Copy link
Collaborator

Wow, good catch.

@rspilker
Copy link
Collaborator

I cannot reproduce the problem using 1.18.6 and javac 11.

@rspilker
Copy link
Collaborator

rspilker commented Feb 19, 2019

Oh, and we will not create List<Class<? extends Serializable>> but List<Class<? extends Object>>.

@rspilker rspilker reopened this Feb 19, 2019
@rspilker
Copy link
Collaborator

Can you verify your Eclipse works with the latest edge release?

@dastamatis
Copy link
Author

Yup, works now. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.
Projects
None yet
Development

No branches or pull requests

2 participants