mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
JavaPsiRecordUtil: isCanonicalConstructor fixed for record w/o components; testdata fixed (IDEA-CR-56742)
GitOrigin-RevId: a179e7ddf958f6f7c76e72187a0044d2da6cc936
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cc61ddeaf4
commit
14c82dcf4f
@@ -59,7 +59,7 @@ public class JavaPsiRecordUtil {
|
||||
* @return true if given method is a canonical (non-compact) constructor for a record class
|
||||
*/
|
||||
public static boolean isCanonicalConstructor(@NotNull PsiMethod method) {
|
||||
if (!method.isConstructor()) return false;
|
||||
if (!method.isConstructor() || isCompactConstructor(method)) return false;
|
||||
PsiClass aClass = method.getContainingClass();
|
||||
if (aClass == null || !aClass.isRecord()) return false;
|
||||
return hasCanonicalSignature(method, aClass.getRecordComponents());
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ record Throws(int x) {
|
||||
public Throws<error descr="Identifier expected"> </error><error descr="Unexpected token">throws</error> <error descr="Invalid method declaration; return type required">Throwable</error> {}
|
||||
}
|
||||
record Generic() {
|
||||
public <error descr="Canonical constructor cannot have type parameters"><T></error> Generic() {}
|
||||
public <error descr="Compact constructor cannot have type parameters"><T></error> Generic {}
|
||||
}
|
||||
record Delegate(int x) {
|
||||
public Delegate {
|
||||
|
||||
Reference in New Issue
Block a user