mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] [highlighting] don't report inferred wildcards (IDEA-294000)
GitOrigin-RevId: a17933972fc5cb31e03e3b7a145f5d721e356d25
This commit is contained in:
committed by
intellij-monorepo-bot
parent
62ce7483bd
commit
cf6ef89010
+1
-1
@@ -775,7 +775,7 @@ public final class GenericsHighlightUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (!typeElement.isInferredType()){
|
||||
String description = JavaErrorBundle.message("generics.wildcards.may.be.used.only.as.reference.parameters");
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement).descriptionAndTooltip(description).create();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class MyTest {
|
||||
static <T extends Iterable<?>> void print(T collection) {
|
||||
for (var item : collection) {
|
||||
System.out.println(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.java.codeInsight.daemon;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
@@ -61,6 +61,8 @@ public class LightAdvLVTIHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testWildcardInference() { doTest(); }
|
||||
|
||||
public void testGotoDeclarationOnVar() {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");
|
||||
final int offset = getEditor().getCaretModel().getOffset();
|
||||
|
||||
Reference in New Issue
Block a user