mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-14 13:06:52 +07:00
This patch fixes the problems with reporting errors when: - a class that is annotated with PreviewFeature instantiated; - a method that is annotated with PreviewFeature used in a method reference; - a class or an interface that is annotated with PreviewFeature is inherited Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: 586caeddae4446ad398878e0bd4bf66858e4518c
31 lines
1.3 KiB
Java
31 lines
1.3 KiB
Java
import jdk.internal.PreviewFeature;
|
|
import jdk.internal.PreviewFeature.Feature;
|
|
|
|
class Main {
|
|
@PreviewFeature(feature=Feature.PATTERN_MATCHING_IN_INSTANCEOF)
|
|
static String instanceOf;
|
|
@PreviewFeature(feature=Feature.RECORDS)
|
|
static long records;
|
|
@PreviewFeature(feature=Feature.TEXT_BLOCKS)
|
|
String textBlocks;
|
|
int i;
|
|
<error descr="Patterns in 'instanceof' are not supported at language level '9'">org.myorg.preview.FromPreview</error> preview;
|
|
|
|
static {
|
|
String s = <error descr="Text block literals are not supported at language level '9'">new Main().textBlocks</error>;
|
|
String o = <error descr="Patterns in 'instanceof' are not supported at language level '9'">Main.instanceOf</error>;
|
|
long l = <error descr="Records are not supported at language level '9'">records</error>;
|
|
int k = new Main().i;
|
|
<error descr="Patterns in 'instanceof' are not supported at language level '9'">org.myorg.preview.FromPreview</error> local = null;
|
|
}
|
|
void f(<error descr="Text block literals are not supported at language level '9'">NotDirectlyAnnotatedField</error> a) {
|
|
<error descr="Text block literals are not supported at language level '9'">a.id</error> = 0;
|
|
}
|
|
|
|
}
|
|
|
|
@PreviewFeature(feature=Feature.TEXT_BLOCKS)
|
|
class NotDirectlyAnnotatedField {
|
|
int id;
|
|
}
|