Skip to content

@Canonical, @Immutable and @TupleConstructor not properly supported #421

@mauromol

Description

@mauromol

Consider this example:

import groovy.transform.TupleConstructor

@TupleConstructor
class TestRecord  {
	String foo
	String bar
}

and the following Java class:

public class Test {

	public static void main(String[] args) {
		TestRecord t = new TestRecord("a", "b");
		System.out.println(t.getFoo());
	}
}

The editor shows a compilation error on the constructor call, but not on the Project Explorer. If you run this code, it works fine at runtime, so there seems to be some discrepancy between what the compiler does and what the parser says.
The same applies if you replace @TupleConstructor with @Canonical.
However, with @Immutable all works fine instead!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions