From bd9254597dd9182d4c34d14041eefbd92be08a2b Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Mon, 6 Aug 2018 18:48:51 +0300 Subject: [PATCH] Fix testdata after switching idea version to 182 The source of testdata change is following commit from the intellij-community repo: d2bfe3d14bfa48af585f1faddc9a0c37dc05e724 It changes how Java-resolution resolves constructors: - before, *any* PsiMethod without type reference was treated as constructor - now, PsiMethod without type reference is treated as constructor only if their *names also match* In particular, in this test, 'void () {}', surprisingly, doesn't have a type reference ('void' is parsed as PsiErrorElement:Identifier expected), its name is '', and its visibility is 'package-private' (!) Therefore, previously we thought that 'Nameless' has package-private constructor and were reporting INVISIBLE_MEMBER. Now we don't see any constructor so we add default constructor, which has public-visibility -> error is gone. Note that this change affects behavior only when "red" code is already present in the project (for "green" code, assumption "method without type reference is a constructor" is indeed correct). --- compiler/testData/diagnostics/tests/recovery/namelessInJava.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/testData/diagnostics/tests/recovery/namelessInJava.kt b/compiler/testData/diagnostics/tests/recovery/namelessInJava.kt index 8ae5b50d09e..cc3d82a94f2 100644 --- a/compiler/testData/diagnostics/tests/recovery/namelessInJava.kt +++ b/compiler/testData/diagnostics/tests/recovery/namelessInJava.kt @@ -12,7 +12,7 @@ public class Nameless { import p.* -class K : Nameless() { +class K : Nameless() { fun () {} val : Int = 1 } \ No newline at end of file