JetBrains / JetBrains/java-annotations

@Language should be applicable as a type-annotation.

未关闭
#43 2 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Kotlin
星标
463
派生
72
PR 合并指标
30 天内没有已合并 PR

描述

# Description

`@Target` `ElementType.TYPE_USE` may be added to `@Language` annotation to allow its usage in applicablecontexts.

# Example

Currently the following example won't compile although it is logical:
```java
private final @NotNull Map<@NotNull NamespacedKey, @Language("json") @NotNull String> addedAdvancements;
```

Another positive side is that while currently IntelliJ warns on incorrect order in the following case:
```java
public void addAdvancement(final @NotNull NamespacedKey key,
final @Language("json") @NotNull String advancementJson) { /* ... */ }
```
suggesting swapping of `final` and `@Language("json")`, this wouldn't be true if `TYPE_USE` was present on the annotation.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。