无法构建实际的Intellij IDEA社区版



我正在尝试按照以下步骤操作。

我在"制作项目"步骤上遇到问题:

invalid inferred types for T,A; inferred type does not conform to declared bound(s)
inferred: java.lang.Object
bound(s): T

in ("return addAll(newHashSet(items));")

@NotNull
public static <T> Set<T> set(@NotNull T ... items) {
  return addAll(newHashSet(items));
}
@NotNull
public static <T, A extends T, C extends Collection<T>> C addAll(@NotNull C collection, @NotNull A... elements) {
  //noinspection ManualArrayToCollectionCopy
  for (T element : elements) {
    collection.add(element);
  }
  return collection;
}

这似乎很奇怪 - 源代码是实际的,我认为这可能是项目配置中的问题。有什么想法吗?

更多信息会有所帮助。比如你运行的是哪个Java?您的环境设置已列出。

最新更新