eclipse-jdtls/eclipse-jdt-core-incubator

Could not accurately convert diagnostic (compiler.err.record.cannot.declare.instance.fields)

Opened this issue · 0 comments

eg

Could not accurately convert diagnostic (compiler.err.record.cannot.declare.instance.fields)
/home/mistria/workspace/sandboxJava/src/sandboxJava/RGB.java: error: field declaration must be static
	public int red;
	           ^
  (consider replacing field with record component)

for eg

public record RGB(int red, int green, int blue) implements Serializable {

	/**
	 * the red component of the RGB
	 */
	public int red;

	/**
	 * the green component of the RGB
	 */
	public int green;

	/**
	 * the blue component of the RGB
	 */
	public int blue;
}