Skip to content

JDT error when closure expression used as annotation attribute value for Class<? extends SAMType> #1201

@eric-milles

Description

@eric-milles

Consider the following:

import java.lang.annotation.*

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@interface A {
  Class<? extends Iterable<String>> value()
}

@A(value = { ['1','2','3'] })
class C {
}

The annotation A accepts a closure for the value attribute. However there is a compiler error displayed for this combination.

image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions