Temporarily remove JvmPackageName and tests, but keep the implementation

This is needed because we want the compiler code to stay as much the
same in master and in 1.2 as possible
This commit is contained in:
Alexander Udalov
2017-09-13 16:07:54 +03:00
parent e8e38d90ff
commit 9ae6feb2c5
35 changed files with 0 additions and 498 deletions
@@ -1,18 +0,0 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.2
// FILE: foo.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("jjj")
fun f(): String = "O"
val g: String? get() = "K"
inline fun i(block: () -> String) = block()
// FILE: bar.kt
fun box(): String = i { f() + g }
-21
View File
@@ -1,21 +0,0 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.2
// FILE: foo.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
package foo.bar
fun f(): String = "O"
val g: String? get() = "K"
inline fun <T> i(block: () -> T): T = block()
// FILE: bar.kt
import foo.bar.*
fun box(): String = i { f() + g }
@@ -1,19 +0,0 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.2
// FILE: foo.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("jjj")
@file:JvmName("Foooo")
fun f(): String = "O"
val g: String? get() = "K"
inline fun i(block: () -> String) = block()
// FILE: bar.kt
fun box(): String = i { f() + g }
@@ -1,21 +0,0 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.2
// FILE: 1.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
package foo.bar
fun f(): String = "O"
val g: String? get() = "K"
inline fun <T> i(block: () -> T): T = block()
// FILE: 2.kt
import foo.bar.*
fun box(): String = i { f() + g }
@@ -1,26 +0,0 @@
// IGNORE_BACKEND: NATIVE
// FILE: A.kt
// LANGUAGE_VERSION: 1.2
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("bar")
package foo
fun f() = "OK"
var v: Int = 1
inline fun i(block: () -> Unit) = block()
// FILE: B.kt
// LANGUAGE_VERSION: 1.2
import foo.*
fun box(): String {
v = 2
if (v != 2) return "Fail"
i { v = 3 }
if (v != 3) return "Fail"
return f()
}
@@ -1,19 +0,0 @@
// IGNORE_BACKEND: NATIVE
// FILE: A.kt
// LANGUAGE_VERSION: 1.2
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("bar")
fun f() = "OK"
var v: Int = 1
// FILE: B.kt
// LANGUAGE_VERSION: 1.2
fun box(): String {
v = 2
if (v != 2) return "Fail"
return f()
}
@@ -1,23 +0,0 @@
// IGNORE_BACKEND: NATIVE
// FILE: A.kt
// LANGUAGE_VERSION: 1.2
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("bar")
@file:JvmName("Baz")
package foo
fun f() = "OK"
var v: Int = 1
// FILE: B.kt
// LANGUAGE_VERSION: 1.2
import foo.*
fun box(): String {
v = 2
if (v != 2) return "Fail"
return f()
}
@@ -1,34 +0,0 @@
// !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE
// !API_VERSION: 1.2
// FILE: a.kt
<!JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_MULTIFILE_CLASSES!>@file:JvmPackageName("a")<!>
@file:JvmMultifileClass
package a
fun a() {}
// FILE: b.kt
<!JVM_PACKAGE_NAME_CANNOT_BE_EMPTY!>@file:JvmPackageName("")<!>
package b
fun b() {}
// FILE: c.kt
<!JVM_PACKAGE_NAME_MUST_BE_VALID_NAME!>@file:JvmPackageName("invalid-fq-name")<!>
package c
fun c() {}
// FILE: d.kt
<!JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_FILES_WITH_CLASSES!>@file:JvmPackageName("d")<!>
package d
class D
fun d() {}
// FILE: e.kt
@file:JvmPackageName(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>42<!>)
package e
fun e() {}
// FILE: f.kt
@file:JvmPackageName(<!EXPRESSION_EXPECTED_PACKAGE_FOUND!>f<!>)
package f
const val name = "f"
@@ -1,32 +0,0 @@
package
package a {
public fun a(): kotlin.Unit
}
package b {
public fun b(): kotlin.Unit
}
package c {
public fun c(): kotlin.Unit
}
package d {
public fun d(): kotlin.Unit
public final class D {
public constructor D()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
package e {
public fun e(): kotlin.Unit
}
package f {
public const val name: kotlin.String = "f"
}
@@ -1,5 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j")
package bar
fun file0() {}
@@ -1,6 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmName("JJ")
@file:JvmPackageName("jj")
package bar
fun jj() {}
@@ -1,3 +0,0 @@
package foo
fun file1() {}
@@ -1,5 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("jjj")
package foo
fun file2() {}
@@ -1,5 +0,0 @@
@file:JvmMultifileClass
@file:JvmName("MultiFoo")
package foo
fun multiFile1() {}
@@ -1,7 +0,0 @@
bar
j/BarAsJKt
jj/JJ
foo
foo/MultiFoo__FooMultiFileKt (foo/MultiFoo)
foo/FooKt
jjj/FooAsJJJKt
@@ -1,3 +0,0 @@
package foo
fun file1() {}
@@ -1,5 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j")
package foo
fun file2() {}
@@ -1,2 +0,0 @@
foo
foo/FooKt
@@ -1,5 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("foo.jvm")
package foo
fun foo1() {}
@@ -1,5 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("foo.jvm")
package foo
fun foo2() {}
@@ -1,5 +0,0 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("foo.jvm")
package foo
fun foo3() {}
@@ -1,4 +0,0 @@
foo
foo/jvm/Foo1Kt
foo/jvm/Foo2Kt
foo/jvm/Foo3Kt
@@ -10401,33 +10401,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
}
}
@TestMetadata("compiler/testData/codegen/box/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractIrBlackBoxCodegenTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("rootPackage.kt")
public void testRootPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/rootPackage.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/simple.kt");
doTest(fileName);
}
@TestMetadata("withJvmName.kt")
public void testWithJvmName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/withJvmName.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1572,21 +1572,6 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
}
}
@TestMetadata("compiler/testData/codegen/boxInline/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractIrBlackBoxInlineCodegenTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/jvmPackageName/simple.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/lambdaClassClash")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1572,21 +1572,6 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
}
}
@TestMetadata("compiler/testData/codegen/boxInline/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractIrCompileKotlinAgainstInlineKotlinTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/jvmPackageName/simple.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/lambdaClassClash")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -539,21 +539,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractDiagnosticsTestWithStdLib {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("incorrectJvmPackageName.kt")
public void testIncorrectJvmPackageName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmPackageName/incorrectJvmPackageName.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -539,21 +539,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractDiagnosticsTestWithStdLibUsingJavac {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("incorrectJvmPackageName.kt")
public void testIncorrectJvmPackageName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmPackageName/incorrectJvmPackageName.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -10401,33 +10401,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("rootPackage.kt")
public void testRootPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/rootPackage.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/simple.kt");
doTest(fileName);
}
@TestMetadata("withJvmName.kt")
public void testWithJvmName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/withJvmName.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1572,21 +1572,6 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
}
}
@TestMetadata("compiler/testData/codegen/boxInline/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractBlackBoxInlineCodegenTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/jvmPackageName/simple.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/lambdaClassClash")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1572,21 +1572,6 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
}
}
@TestMetadata("compiler/testData/codegen/boxInline/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractCompileKotlinAgainstInlineKotlinTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/jvmPackageName/simple.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/lambdaClassClash")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -138,24 +138,6 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
doTest(fileName);
}
@TestMetadata("jvmPackageName.kt")
public void testJvmPackageName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/jvmPackageName.kt");
doTest(fileName);
}
@TestMetadata("jvmPackageNameInRootPackage.kt")
public void testJvmPackageNameInRootPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt");
doTest(fileName);
}
@TestMetadata("jvmPackageNameWithJvmName.kt")
public void testJvmPackageNameWithJvmName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt");
doTest(fileName);
}
@TestMetadata("jvmStaticInObject.kt")
public void testJvmStaticInObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/jvmStaticInObject.kt");
@@ -76,19 +76,4 @@ class JvmPackageTableTest : KtUsefulTestCase() {
fun testSimple() {
doTest("/jvmPackageTable/simple")
}
fun testJvmPackageName() {
doTest("/jvmPackageTable/jvmPackageName",
compileWith = LanguageVersion.KOTLIN_1_2, loadWith = LanguageVersion.KOTLIN_1_2)
}
fun testJvmPackageNameManyParts() {
doTest("/jvmPackageTable/jvmPackageNameManyParts",
compileWith = LanguageVersion.KOTLIN_1_2, loadWith = LanguageVersion.KOTLIN_1_2)
}
fun testJvmPackageNameLanguageVersion11() {
doTest("/jvmPackageTable/jvmPackageNameLanguageVersion11",
compileWith = LanguageVersion.KOTLIN_1_2, loadWith = LanguageVersion.KOTLIN_1_1)
}
}
@@ -10401,33 +10401,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractLightAnalysisModeTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("rootPackage.kt")
public void testRootPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/rootPackage.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/simple.kt");
doTest(fileName);
}
@TestMetadata("withJvmName.kt")
public void testWithJvmName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmPackageName/withJvmName.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -62,18 +62,6 @@ public annotation class JvmName(val name: String)
@MustBeDocumented
public annotation class JvmMultifileClass
/**
* Changes the fully qualified name of the JVM package of the .class file generated from this file.
* This does not affect the way Kotlin clients will see the declarations in this file, but Java clients and other JVM language clients
* will see the class file as if it was declared in the specified package.
* If a file is annotated with this annotation, it can only have function, property and typealias declarations, but no classes.
*/
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
@SinceKotlin("1.2")
internal annotation class JvmPackageName(val name: String)
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD)
@Retention(AnnotationRetention.SOURCE)
public annotation class JvmSynthetic
@@ -11733,15 +11733,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/jvmPackageName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmPackageName extends AbstractJsCodegenBoxTest {
public void testAllFilesPresentInJvmPackageName() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmPackageName"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)