Got rid of "namespace" word in test data.
This commit is contained in:
@@ -64,7 +64,7 @@ public class SpecialFiles {
|
|||||||
|
|
||||||
excludedFiles.add("nestedInPackage.kt"); // Cannot change package name
|
excludedFiles.add("nestedInPackage.kt"); // Cannot change package name
|
||||||
excludedFiles.add("importNestedClass.kt"); // Cannot change package name
|
excludedFiles.add("importNestedClass.kt"); // Cannot change package name
|
||||||
excludedFiles.add("namespaceQualifiedMethod.kt"); // Cannot change package name
|
excludedFiles.add("packageQualifiedMethod.kt"); // Cannot change package name
|
||||||
excludedFiles.add("classObjectToString.kt"); // Cannot change package name
|
excludedFiles.add("classObjectToString.kt"); // Cannot change package name
|
||||||
|
|
||||||
excludedFiles.add("kt326.kt"); // Commented
|
excludedFiles.add("kt326.kt"); // Commented
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// FILE: b.kt
|
// FILE: b.kt
|
||||||
package MyNamespace
|
package MyPackage
|
||||||
//properties
|
//properties
|
||||||
<!MUST_BE_INITIALIZED!>val a: Int<!>
|
<!MUST_BE_INITIALIZED!>val a: Int<!>
|
||||||
val a1: Int = 1
|
val a1: Int = 1
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ fun Any?.vars(<!UNUSED_PARAMETER!>a<!>: Any?) : Int {
|
|||||||
if (example.ns.y is Int) {
|
if (example.ns.y is Int) {
|
||||||
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>example.ns.y<!>
|
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>example.ns.y<!>
|
||||||
}
|
}
|
||||||
// if (namespace.bottles.ns.y is Int) {
|
// if (package.bottles.ns.y is Int) {
|
||||||
// b = ns.y
|
// b = ns.y
|
||||||
// }
|
// }
|
||||||
if (Obj.y is Int) {
|
if (Obj.y is Int) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//namespace override
|
package override
|
||||||
|
|
||||||
trait T {
|
trait T {
|
||||||
fun foo()
|
fun foo()
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class TestBackingFieldsVisibility() {
|
|||||||
<!INACCESSIBLE_BACKING_FIELD!>a.$a<!> = 3
|
<!INACCESSIBLE_BACKING_FIELD!>a.$a<!> = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
val x = <!INACCESSIBLE_BACKING_FIELD!>$namespaceLevelVar<!>
|
val x = <!INACCESSIBLE_BACKING_FIELD!>$topLevelVar<!>
|
||||||
|
|
||||||
inner class Inner() {
|
inner class Inner() {
|
||||||
val z = this@TestBackingFieldsVisibility.$x
|
val z = this@TestBackingFieldsVisibility.$x
|
||||||
@@ -117,7 +117,7 @@ class TestBackingFieldsVisibility() {
|
|||||||
get() = $w //test there is no second error here
|
get() = $w //test there is no second error here
|
||||||
}
|
}
|
||||||
|
|
||||||
val namespaceLevelVar = 11
|
val topLevelVar = 11
|
||||||
|
|
||||||
class T() {
|
class T() {
|
||||||
val z : Int get() = 42
|
val z : Int get() = 42
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
// FILE: ns1.kt
|
// FILE: pkg1.kt
|
||||||
// check no error in overload in different namespaces
|
// check no error in overload in different packages
|
||||||
|
|
||||||
package ns1
|
package pkg1
|
||||||
fun e() = 1
|
fun e() = 1
|
||||||
|
|
||||||
// FILE: ns2.kt
|
// FILE: pkg2.kt
|
||||||
package ns2
|
package pkg2
|
||||||
fun e() = 1
|
fun e() = 1
|
||||||
|
|
||||||
// FILE: ns3ns1.kt
|
// FILE: pkg3pkg1.kt
|
||||||
package ns3.ns1
|
package pkg3.pkg1
|
||||||
fun e() = 1
|
fun e() = 1
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class A() {
|
|||||||
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
|
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
|
||||||
}
|
}
|
||||||
|
|
||||||
//in a namespace
|
//in a package
|
||||||
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
|
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
|
||||||
|
|
||||||
//KT-787 AssertionError on code 'val x = x'
|
//KT-787 AssertionError on code 'val x = x'
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
JetFile: NamespaceBlockFirst.kt
|
JetFile: PackageBlockFirst.kt
|
||||||
PACKAGE_DIRECTIVE
|
PACKAGE_DIRECTIVE
|
||||||
<empty list>
|
<empty list>
|
||||||
PsiErrorElement:Expecting package directive or top level declaration
|
PsiErrorElement:Expecting package directive or top level declaration
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
JetFile: NamespaceModifiers.kt
|
JetFile: PackageModifiers.kt
|
||||||
PACKAGE_DIRECTIVE
|
PACKAGE_DIRECTIVE
|
||||||
MODIFIER_LIST
|
MODIFIER_LIST
|
||||||
PsiElement(public)('public')
|
PsiElement(public)('public')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[`return`] fun `namespace`() {
|
[`return`] fun `package`() {
|
||||||
`class`()
|
`class`()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ JetFile: QuotedIdentifiers.kt
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiElement(fun)('fun')
|
PsiElement(fun)('fun')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiElement(IDENTIFIER)('`namespace`')
|
PsiElement(IDENTIFIER)('`package`')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(RPAR)(')')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package n {
|
|||||||
}
|
}
|
||||||
abstract class XXX() {
|
abstract class XXX() {
|
||||||
abstract val a : Int
|
abstract val a : Int
|
||||||
abstract val a1 : namespace.Int
|
abstract val a1 : package.Int
|
||||||
abstract val a2 : n.B
|
abstract val a2 : n.B
|
||||||
abstract val a3 : (A)
|
abstract val a3 : (A)
|
||||||
abstract val a31 : (n.B)
|
abstract val a31 : (n.B)
|
||||||
|
|||||||
@@ -74,9 +74,7 @@ JetFile: functionTypes.kt
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
USER_TYPE
|
PsiElement(package)('package')
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('namespace')
|
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('Int')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
|
|||||||
@@ -309,11 +309,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/NamedArgumentsAndDefaultValues.kt");
|
doTest("compiler/testData/diagnostics/tests/NamedArgumentsAndDefaultValues.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NamespaceQualified.kt")
|
|
||||||
public void testNamespaceQualified() throws Exception {
|
|
||||||
doTest("compiler/testData/diagnostics/tests/NamespaceQualified.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("Nullability.kt")
|
@TestMetadata("Nullability.kt")
|
||||||
public void testNullability() throws Exception {
|
public void testNullability() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/Nullability.kt");
|
doTest("compiler/testData/diagnostics/tests/Nullability.kt");
|
||||||
@@ -344,6 +339,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt");
|
doTest("compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PackageQualified.kt")
|
||||||
|
public void testPackageQualified() throws Exception {
|
||||||
|
doTest("compiler/testData/diagnostics/tests/PackageQualified.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("PrimaryConstructors.kt")
|
@TestMetadata("PrimaryConstructors.kt")
|
||||||
public void testPrimaryConstructors() throws Exception {
|
public void testPrimaryConstructors() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/PrimaryConstructors.kt");
|
doTest("compiler/testData/diagnostics/tests/PrimaryConstructors.kt");
|
||||||
@@ -404,9 +404,9 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt");
|
doTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("SafeCallOnFakeNamespace.kt")
|
@TestMetadata("SafeCallOnFakePackage.kt")
|
||||||
public void testSafeCallOnFakeNamespace() throws Exception {
|
public void testSafeCallOnFakePackage() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/SafeCallOnFakeNamespace.kt");
|
doTest("compiler/testData/diagnostics/tests/SafeCallOnFakePackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ShiftFunctionTypes.kt")
|
@TestMetadata("ShiftFunctionTypes.kt")
|
||||||
@@ -688,9 +688,9 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/backingField/kt462BackingFieldsResolve.kt");
|
doTest("compiler/testData/diagnostics/tests/backingField/kt462BackingFieldsResolve.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt782namespaceLevel.kt")
|
@TestMetadata("kt782packageLevel.kt")
|
||||||
public void testKt782namespaceLevel() throws Exception {
|
public void testKt782packageLevel() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/backingField/kt782namespaceLevel.kt");
|
doTest("compiler/testData/diagnostics/tests/backingField/kt782packageLevel.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("qualifiedWithThis.kt")
|
@TestMetadata("qualifiedWithThis.kt")
|
||||||
@@ -2652,9 +2652,9 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/enum/classObjectOfPrivateEnum.kt");
|
doTest("compiler/testData/diagnostics/tests/enum/classObjectOfPrivateEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("dontCreateNamespaceTypeForEnumEntry.kt")
|
@TestMetadata("dontCreatePackageTypeForEnumEntry.kt")
|
||||||
public void testDontCreateNamespaceTypeForEnumEntry() throws Exception {
|
public void testDontCreatePackageTypeForEnumEntry() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/enum/dontCreateNamespaceTypeForEnumEntry.kt");
|
doTest("compiler/testData/diagnostics/tests/enum/dontCreatePackageTypeForEnumEntry.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("entryShouldBeOfEnumType.kt")
|
@TestMetadata("entryShouldBeOfEnumType.kt")
|
||||||
|
|||||||
+3
-3
@@ -46,9 +46,9 @@ public class TopLevelMembersInvocationTestGenerated extends AbstractTopLevelMemb
|
|||||||
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionDifferentPackage");
|
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionDifferentPackage");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("functionInMultiFileNamespace")
|
@TestMetadata("functionInMultiFilePackage")
|
||||||
public void testFunctionInMultiFileNamespace() throws Exception {
|
public void testFunctionInMultiFilePackage() throws Exception {
|
||||||
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionInMultiFileNamespace");
|
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionInMultiFilePackage");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("functionSamePackage")
|
@TestMetadata("functionSamePackage")
|
||||||
|
|||||||
+48
-48
@@ -31,7 +31,7 @@ import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest;
|
|||||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/codegen/box")
|
@TestMetadata("compiler/testData/codegen/box")
|
||||||
@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.BinaryOp.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.BuiltinStubMethods.class, BlackBoxCodegenTestGenerated.CallableReference.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.Constants.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.DelegatedProperty.class, BlackBoxCodegenTestGenerated.Elvis.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExclExcl.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.FakeOverride.class, BlackBoxCodegenTestGenerated.FieldRename.class, BlackBoxCodegenTestGenerated.Finally.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Namespace.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Reflection.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.SamConstructors.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.ToArray.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.TypeMapping.class, BlackBoxCodegenTestGenerated.UnaryOp.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class})
|
@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.BinaryOp.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.BuiltinStubMethods.class, BlackBoxCodegenTestGenerated.CallableReference.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.Constants.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.DelegatedProperty.class, BlackBoxCodegenTestGenerated.Elvis.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExclExcl.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.FakeOverride.class, BlackBoxCodegenTestGenerated.FieldRename.class, BlackBoxCodegenTestGenerated.Finally.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.Package.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Reflection.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.SamConstructors.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.ToArray.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.TypeMapping.class, BlackBoxCodegenTestGenerated.UnaryOp.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class})
|
||||||
public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||||
public void testAllFilesPresentInBox() throws Exception {
|
public void testAllFilesPresentInBox() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
@@ -2506,9 +2506,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest("compiler/testData/codegen/box/fieldRename/genericPropertyWithItself.kt");
|
doTest("compiler/testData/codegen/box/fieldRename/genericPropertyWithItself.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("inNamespace.kt")
|
@TestMetadata("inPackage.kt")
|
||||||
public void testInNamespace() throws Exception {
|
public void testInPackage() throws Exception {
|
||||||
doTest("compiler/testData/codegen/box/fieldRename/inNamespace.kt");
|
doTest("compiler/testData/codegen/box/fieldRename/inPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
@@ -3837,49 +3837,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/namespace")
|
|
||||||
public static class Namespace extends AbstractBlackBoxCodegenTest {
|
|
||||||
public void testAllFilesPresentInNamespace() throws Exception {
|
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box/namespace"), Pattern.compile("^(.+)\\.kt$"), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("boxPrimitiveTypeInClinit.kt")
|
|
||||||
public void testBoxPrimitiveTypeInClinit() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/boxPrimitiveTypeInClinit.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("checkCast.kt")
|
|
||||||
public void testCheckCast() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/checkCast.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("incrementProperty.kt")
|
|
||||||
public void testIncrementProperty() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/incrementProperty.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("invokespecial.kt")
|
|
||||||
public void testInvokespecial() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/invokespecial.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("namespaceQualifiedMethod.kt")
|
|
||||||
public void testNamespaceQualifiedMethod() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/namespaceQualifiedMethod.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("nullablePrimitiveNoFieldInitializer.kt")
|
|
||||||
public void testNullablePrimitiveNoFieldInitializer() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/nullablePrimitiveNoFieldInitializer.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("privateTopLevelPropAndVarInInner.kt")
|
|
||||||
public void testPrivateTopLevelPropAndVarInInner() throws Exception {
|
|
||||||
doTest("compiler/testData/codegen/box/namespace/privateTopLevelPropAndVarInInner.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/objects")
|
@TestMetadata("compiler/testData/codegen/box/objects")
|
||||||
public static class Objects extends AbstractBlackBoxCodegenTest {
|
public static class Objects extends AbstractBlackBoxCodegenTest {
|
||||||
public void testAllFilesPresentInObjects() throws Exception {
|
public void testAllFilesPresentInObjects() throws Exception {
|
||||||
@@ -4116,6 +4073,49 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/package")
|
||||||
|
public static class Package extends AbstractBlackBoxCodegenTest {
|
||||||
|
public void testAllFilesPresentInPackage() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box/package"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("boxPrimitiveTypeInClinit.kt")
|
||||||
|
public void testBoxPrimitiveTypeInClinit() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/boxPrimitiveTypeInClinit.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("checkCast.kt")
|
||||||
|
public void testCheckCast() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/checkCast.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("incrementProperty.kt")
|
||||||
|
public void testIncrementProperty() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/incrementProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("invokespecial.kt")
|
||||||
|
public void testInvokespecial() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/invokespecial.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nullablePrimitiveNoFieldInitializer.kt")
|
||||||
|
public void testNullablePrimitiveNoFieldInitializer() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/nullablePrimitiveNoFieldInitializer.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageQualifiedMethod.kt")
|
||||||
|
public void testPackageQualifiedMethod() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/packageQualifiedMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateTopLevelPropAndVarInInner.kt")
|
||||||
|
public void testPrivateTopLevelPropAndVarInInner() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/package/privateTopLevelPropAndVarInInner.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/primitiveTypes")
|
@TestMetadata("compiler/testData/codegen/box/primitiveTypes")
|
||||||
public static class PrimitiveTypes extends AbstractBlackBoxCodegenTest {
|
public static class PrimitiveTypes extends AbstractBlackBoxCodegenTest {
|
||||||
public void testAllFilesPresentInPrimitiveTypes() throws Exception {
|
public void testAllFilesPresentInPrimitiveTypes() throws Exception {
|
||||||
@@ -5246,9 +5246,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
suite.addTestSuite(Labels.class);
|
suite.addTestSuite(Labels.class);
|
||||||
suite.addTestSuite(LocalClasses.class);
|
suite.addTestSuite(LocalClasses.class);
|
||||||
suite.addTest(MultiDecl.innerSuite());
|
suite.addTest(MultiDecl.innerSuite());
|
||||||
suite.addTestSuite(Namespace.class);
|
|
||||||
suite.addTestSuite(Objects.class);
|
suite.addTestSuite(Objects.class);
|
||||||
suite.addTest(OperatorConventions.innerSuite());
|
suite.addTest(OperatorConventions.innerSuite());
|
||||||
|
suite.addTestSuite(Package.class);
|
||||||
suite.addTestSuite(PrimitiveTypes.class);
|
suite.addTestSuite(PrimitiveTypes.class);
|
||||||
suite.addTestSuite(Properties.class);
|
suite.addTestSuite(Properties.class);
|
||||||
suite.addTestSuite(Reflection.class);
|
suite.addTestSuite(Reflection.class);
|
||||||
|
|||||||
@@ -267,16 +267,6 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
|
|||||||
doParsingTest("compiler/testData/psi/MultiVariableDeclarations.kt");
|
doParsingTest("compiler/testData/psi/MultiVariableDeclarations.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NamespaceBlockFirst.kt")
|
|
||||||
public void testNamespaceBlockFirst() throws Exception {
|
|
||||||
doParsingTest("compiler/testData/psi/NamespaceBlockFirst.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("NamespaceModifiers.kt")
|
|
||||||
public void testNamespaceModifiers() throws Exception {
|
|
||||||
doParsingTest("compiler/testData/psi/NamespaceModifiers.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("NestedComments.kt")
|
@TestMetadata("NestedComments.kt")
|
||||||
public void testNestedComments() throws Exception {
|
public void testNestedComments() throws Exception {
|
||||||
doParsingTest("compiler/testData/psi/NestedComments.kt");
|
doParsingTest("compiler/testData/psi/NestedComments.kt");
|
||||||
@@ -302,6 +292,16 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
|
|||||||
doParsingTest("compiler/testData/psi/ObjectLiteralAsStatement.kt");
|
doParsingTest("compiler/testData/psi/ObjectLiteralAsStatement.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PackageBlockFirst.kt")
|
||||||
|
public void testPackageBlockFirst() throws Exception {
|
||||||
|
doParsingTest("compiler/testData/psi/PackageBlockFirst.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PackageModifiers.kt")
|
||||||
|
public void testPackageModifiers() throws Exception {
|
||||||
|
doParsingTest("compiler/testData/psi/PackageModifiers.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ParameterNameMising.kt")
|
@TestMetadata("ParameterNameMising.kt")
|
||||||
public void testParameterNameMising() throws Exception {
|
public void testParameterNameMising() throws Exception {
|
||||||
doParsingTest("compiler/testData/psi/ParameterNameMising.kt");
|
doParsingTest("compiler/testData/psi/ParameterNameMising.kt");
|
||||||
|
|||||||
@@ -82,11 +82,6 @@ public class ResolveTestGenerated extends AbstractResolveTest {
|
|||||||
doTest("compiler/testData/resolve/LocalObjects.resolve");
|
doTest("compiler/testData/resolve/LocalObjects.resolve");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("Namespaces.resolve")
|
|
||||||
public void testNamespaces() throws Exception {
|
|
||||||
doTest("compiler/testData/resolve/Namespaces.resolve");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("NestedObjects.resolve")
|
@TestMetadata("NestedObjects.resolve")
|
||||||
public void testNestedObjects() throws Exception {
|
public void testNestedObjects() throws Exception {
|
||||||
doTest("compiler/testData/resolve/NestedObjects.resolve");
|
doTest("compiler/testData/resolve/NestedObjects.resolve");
|
||||||
@@ -102,6 +97,11 @@ public class ResolveTestGenerated extends AbstractResolveTest {
|
|||||||
doTest("compiler/testData/resolve/Objects.resolve");
|
doTest("compiler/testData/resolve/Objects.resolve");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("Packages.resolve")
|
||||||
|
public void testPackages() throws Exception {
|
||||||
|
doTest("compiler/testData/resolve/Packages.resolve");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("PrimaryConstructorParameters.resolve")
|
@TestMetadata("PrimaryConstructorParameters.resolve")
|
||||||
public void testPrimaryConstructorParameters() throws Exception {
|
public void testPrimaryConstructorParameters() throws Exception {
|
||||||
doTest("compiler/testData/resolve/PrimaryConstructorParameters.resolve");
|
doTest("compiler/testData/resolve/PrimaryConstructorParameters.resolve");
|
||||||
|
|||||||
@@ -118,34 +118,32 @@ enum class MyEnum() {
|
|||||||
|
|
||||||
abstract enum class MyAbstractEnum() {}
|
abstract enum class MyAbstractEnum() {}
|
||||||
|
|
||||||
//package MyNamespace {
|
//properties
|
||||||
//properties
|
<error>val a: Int</error>
|
||||||
<error>val a: Int</error>
|
val a1: Int = 1
|
||||||
val a1: Int = 1
|
<error><error>abstract</error> val a2: Int</error>
|
||||||
<error><error>abstract</error> val a2: Int</error>
|
<error>abstract</error> val a3: Int = 1
|
||||||
<error>abstract</error> val a3: Int = 1
|
|
||||||
|
|
||||||
<error>var b: Int</error> private set
|
<error>var b: Int</error> private set
|
||||||
var b1: Int = 0; private set
|
var b1: Int = 0; private set
|
||||||
<error><error>abstract</error> var b2: Int</error> private set
|
<error><error>abstract</error> var b2: Int</error> private set
|
||||||
<error>abstract</error> var b3: Int = 0; private set
|
<error>abstract</error> var b3: Int = 0; private set
|
||||||
|
|
||||||
<error>var c: Int</error> set(v: Int) { $c = v }
|
<error>var c: Int</error> set(v: Int) { $c = v }
|
||||||
var c1: Int = 0; set(v: Int) { $c1 = v }
|
var c1: Int = 0; set(v: Int) { $c1 = v }
|
||||||
<error><error>abstract</error> var c2: Int</error> set(v: Int) { $c2 = v }
|
<error><error>abstract</error> var c2: Int</error> set(v: Int) { $c2 = v }
|
||||||
<error>abstract</error> var c3: Int = 0; set(v: Int) { $c3 = v }
|
<error>abstract</error> var c3: Int = 0; set(v: Int) { $c3 = v }
|
||||||
|
|
||||||
val e: Int get() = a
|
val e: Int get() = a
|
||||||
val e1: Int = <error>0</error>; get() = a
|
val e1: Int = <error>0</error>; get() = a
|
||||||
<error>abstract</error> val e2: Int get() = a
|
<error>abstract</error> val e2: Int get() = a
|
||||||
<error>abstract</error> val e3: Int = <error>0</error>; get() = a
|
<error>abstract</error> val e3: Int = <error>0</error>; get() = a
|
||||||
|
|
||||||
//methods
|
//methods
|
||||||
<error>fun f()</error>
|
<error>fun f()</error>
|
||||||
fun g() {}
|
fun g() {}
|
||||||
<error>abstract</error> fun h()
|
<error>abstract</error> fun h()
|
||||||
<error>abstract</error> fun j() {}
|
<error>abstract</error> fun j() {}
|
||||||
//}
|
|
||||||
|
|
||||||
//creating an instance
|
//creating an instance
|
||||||
abstract class B1(
|
abstract class B1(
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ package Tests
|
|||||||
class A : java.<caret>
|
class A : java.<caret>
|
||||||
|
|
||||||
// EXIST: lang, util, io
|
// EXIST: lang, util, io
|
||||||
// ABSENT: fun, val, var, namespace
|
// ABSENT: fun, val, var, package
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ fun foo() {
|
|||||||
str.<caret>
|
str.<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
// ABSENT: namespace, as, type, class, this, super, val, var, fun, for, null, true
|
// ABSENT: package, as, type, class, this, super, val, var, fun, for, null, true
|
||||||
// ABSENT: false, is, in, throw, return, break, continue, object, if, try, else, while
|
// ABSENT: false, is, in, throw, return, break, continue, object, if, try, else, while
|
||||||
// ABSENT: do, when, trait, This
|
// ABSENT: do, when, trait, This
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
package test
|
|
||||||
|
|
||||||
fun foo() {
|
|
||||||
"" // test/TestPackage-namespaceOfPackage
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
"" // test/TestPackage-package
|
||||||
|
}
|
||||||
@@ -7,5 +7,5 @@ package testing
|
|||||||
|
|
||||||
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">testing</info>(<info textAttributesKey="KOTLIN_PARAMETER">t1</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>, <info textAttributesKey="KOTLIN_PARAMETER">t2</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>): <info textAttributesKey="KOTLIN_CLASS">Test</info> {
|
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">testing</info>(<info textAttributesKey="KOTLIN_PARAMETER">t1</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>, <info textAttributesKey="KOTLIN_PARAMETER">t2</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>): <info textAttributesKey="KOTLIN_CLASS">Test</info> {
|
||||||
if (<info textAttributesKey="KOTLIN_PARAMETER">t1</info> != <info textAttributesKey="KOTLIN_PARAMETER">t2</info>) return <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>
|
if (<info textAttributesKey="KOTLIN_PARAMETER">t1</info> != <info textAttributesKey="KOTLIN_PARAMETER">t2</info>) return <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>
|
||||||
return <info textAttributesKey="KOTLIN_NAMESPACE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">testing</info></info>(<info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>, <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">SECOND</info>)
|
return <info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">testing</info></info>(<info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>, <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">SECOND</info>)
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,8 @@ fun <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="K
|
|||||||
|
|
||||||
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">open</info> class <info textAttributesKey="KOTLIN_CLASS">Container</info> {
|
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">open</info> class <info textAttributesKey="KOTLIN_CLASS">Container</info> {
|
||||||
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">open</info> fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">member</info>() {
|
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">open</info> fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">member</info>() {
|
||||||
<info textAttributesKey="KOTLIN_NAMESPACE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">global</info></info>()
|
<info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">global</info></info>()
|
||||||
5.<info textAttributesKey="KOTLIN_EXTENSION_FUNCTION_CALL"><info textAttributesKey="KOTLIN_NAMESPACE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">ext</info></info></info>()
|
5.<info textAttributesKey="KOTLIN_EXTENSION_FUNCTION_CALL"><info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">ext</info></info></info>()
|
||||||
<info textAttributesKey="KOTLIN_FUNCTION_CALL">member</info>()
|
<info textAttributesKey="KOTLIN_FUNCTION_CALL">member</info>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
var <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">x</info></info></info> = 5
|
var <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">x</info></info></info> = 5
|
||||||
|
|
||||||
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">sq</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>
|
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">sq</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>
|
||||||
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
||||||
return this * this
|
return this * this
|
||||||
}
|
}
|
||||||
|
|
||||||
val <info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">y</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
|
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">y</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
|
||||||
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
||||||
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">sq</info></info> + <info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_BACKING_FIELD_ACCESS">$y</info></info> + <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">x</info></info>
|
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">sq</info></info> + <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_BACKING_FIELD_ACCESS">$y</info></info> + <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">x</info></info>
|
||||||
}
|
}
|
||||||
|
|
||||||
class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_INSTANCE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">a</info></info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>, <info textAttributesKey="KOTLIN_PARAMETER">b</info> : <info textAttributesKey="KOTLIN_CLASS">String</info>) {
|
class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_INSTANCE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">a</info></info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>, <info textAttributesKey="KOTLIN_PARAMETER">b</info> : <info textAttributesKey="KOTLIN_CLASS">String</info>) {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ trait <info textAttributesKey="KOTLIN_TRAIT">FunctionLike</info> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var <info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">global</info></info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info> = {}
|
var <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">global</info></info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info> = {}
|
||||||
|
|
||||||
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">ext</info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>
|
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">ext</info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>
|
||||||
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
@@ -13,8 +13,8 @@ val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="K
|
|||||||
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(<info textAttributesKey="KOTLIN_PARAMETER">a</info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>, <info textAttributesKey="KOTLIN_PARAMETER">functionLike</info>: <info textAttributesKey="KOTLIN_TRAIT">FunctionLike</info>) {
|
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(<info textAttributesKey="KOTLIN_PARAMETER">a</info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>, <info textAttributesKey="KOTLIN_PARAMETER">functionLike</info>: <info textAttributesKey="KOTLIN_TRAIT">FunctionLike</info>) {
|
||||||
<info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">a</info></info>()
|
<info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">a</info></info>()
|
||||||
<info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION_LIKE">functionLike</info></info>()
|
<info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION_LIKE">functionLike</info></info>()
|
||||||
<info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">global</info></info></info>()
|
<info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">global</info></info></info>()
|
||||||
1.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">ext</info></info></info>();
|
1.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">ext</info></info></info>();
|
||||||
|
|
||||||
{}() //should not be highlighted as "calling variable as function"!
|
{}() //should not be highlighted as "calling variable as function"!
|
||||||
}
|
}
|
||||||
@@ -143,16 +143,6 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
|
|||||||
doTest("idea/testData/checker/MultipleBounds.kt");
|
doTest("idea/testData/checker/MultipleBounds.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NamespaceAsExpression.kt")
|
|
||||||
public void testNamespaceAsExpression() throws Exception {
|
|
||||||
doTest("idea/testData/checker/NamespaceAsExpression.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("NamespaceQualified.kt")
|
|
||||||
public void testNamespaceQualified() throws Exception {
|
|
||||||
doTest("idea/testData/checker/NamespaceQualified.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("NestedObjects.kt")
|
@TestMetadata("NestedObjects.kt")
|
||||||
public void testNestedObjects() throws Exception {
|
public void testNestedObjects() throws Exception {
|
||||||
doTest("idea/testData/checker/NestedObjects.kt");
|
doTest("idea/testData/checker/NestedObjects.kt");
|
||||||
@@ -183,6 +173,16 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
|
|||||||
doTest("idea/testData/checker/OverridesAndGenerics.kt");
|
doTest("idea/testData/checker/OverridesAndGenerics.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PackageAsExpression.kt")
|
||||||
|
public void testPackageAsExpression() throws Exception {
|
||||||
|
doTest("idea/testData/checker/PackageAsExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PackageQualified.kt")
|
||||||
|
public void testPackageQualified() throws Exception {
|
||||||
|
doTest("idea/testData/checker/PackageQualified.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("PrimaryConstructors.kt")
|
@TestMetadata("PrimaryConstructors.kt")
|
||||||
public void testPrimaryConstructors() throws Exception {
|
public void testPrimaryConstructors() throws Exception {
|
||||||
doTest("idea/testData/checker/PrimaryConstructors.kt");
|
doTest("idea/testData/checker/PrimaryConstructors.kt");
|
||||||
|
|||||||
@@ -259,16 +259,16 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
|||||||
doTest("idea/testData/completion/basic/common/InLongDotQualifiedExpression.kt");
|
doTest("idea/testData/completion/basic/common/InLongDotQualifiedExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("InMiddleOfNamespace.kt")
|
|
||||||
public void testInMiddleOfNamespace() throws Exception {
|
|
||||||
doTest("idea/testData/completion/basic/common/InMiddleOfNamespace.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("InMiddleOfPackage.kt")
|
@TestMetadata("InMiddleOfPackage.kt")
|
||||||
public void testInMiddleOfPackage() throws Exception {
|
public void testInMiddleOfPackage() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/InMiddleOfPackage.kt");
|
doTest("idea/testData/completion/basic/common/InMiddleOfPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("InMiddleOfPackageDirective.kt")
|
||||||
|
public void testInMiddleOfPackageDirective() throws Exception {
|
||||||
|
doTest("idea/testData/completion/basic/common/InMiddleOfPackageDirective.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("InObjectInDelegationSpecifier.kt")
|
@TestMetadata("InObjectInDelegationSpecifier.kt")
|
||||||
public void testInObjectInDelegationSpecifier() throws Exception {
|
public void testInObjectInDelegationSpecifier() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/InObjectInDelegationSpecifier.kt");
|
doTest("idea/testData/completion/basic/common/InObjectInDelegationSpecifier.kt");
|
||||||
@@ -334,9 +334,9 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
|||||||
doTest("idea/testData/completion/basic/common/NoCompletionAfterLong.kt");
|
doTest("idea/testData/completion/basic/common/NoCompletionAfterLong.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NoEmptyNamespace.kt")
|
@TestMetadata("NoEmptyPackage.kt")
|
||||||
public void testNoEmptyNamespace() throws Exception {
|
public void testNoEmptyPackage() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/NoEmptyNamespace.kt");
|
doTest("idea/testData/completion/basic/common/NoEmptyPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NoObjectInTypePosition.kt")
|
@TestMetadata("NoObjectInTypePosition.kt")
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class JetInJavaCompletionTest extends JetCompletionMultiTestBase {
|
|||||||
doFileTest();
|
doFileTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassFromNamespace() {
|
public void testClassFromPackage() {
|
||||||
doFileTest();
|
doFileTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -259,16 +259,16 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
|||||||
doTest("idea/testData/completion/basic/common/InLongDotQualifiedExpression.kt");
|
doTest("idea/testData/completion/basic/common/InLongDotQualifiedExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("InMiddleOfNamespace.kt")
|
|
||||||
public void testInMiddleOfNamespace() throws Exception {
|
|
||||||
doTest("idea/testData/completion/basic/common/InMiddleOfNamespace.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("InMiddleOfPackage.kt")
|
@TestMetadata("InMiddleOfPackage.kt")
|
||||||
public void testInMiddleOfPackage() throws Exception {
|
public void testInMiddleOfPackage() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/InMiddleOfPackage.kt");
|
doTest("idea/testData/completion/basic/common/InMiddleOfPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("InMiddleOfPackageDirective.kt")
|
||||||
|
public void testInMiddleOfPackageDirective() throws Exception {
|
||||||
|
doTest("idea/testData/completion/basic/common/InMiddleOfPackageDirective.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("InObjectInDelegationSpecifier.kt")
|
@TestMetadata("InObjectInDelegationSpecifier.kt")
|
||||||
public void testInObjectInDelegationSpecifier() throws Exception {
|
public void testInObjectInDelegationSpecifier() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/InObjectInDelegationSpecifier.kt");
|
doTest("idea/testData/completion/basic/common/InObjectInDelegationSpecifier.kt");
|
||||||
@@ -334,9 +334,9 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
|||||||
doTest("idea/testData/completion/basic/common/NoCompletionAfterLong.kt");
|
doTest("idea/testData/completion/basic/common/NoCompletionAfterLong.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NoEmptyNamespace.kt")
|
@TestMetadata("NoEmptyPackage.kt")
|
||||||
public void testNoEmptyNamespace() throws Exception {
|
public void testNoEmptyPackage() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/NoEmptyNamespace.kt");
|
doTest("idea/testData/completion/basic/common/NoEmptyPackage.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("NoObjectInTypePosition.kt")
|
@TestMetadata("NoObjectInTypePosition.kt")
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class JetPositionManagerTest extends PositionManagerTestCase {
|
|||||||
return positionManager;
|
return positionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMultiFileNamespace() {
|
public void testMultiFilePackage() {
|
||||||
doMultiTest();
|
doMultiTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ public class JetPositionManagerTest extends PositionManagerTestCase {
|
|||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespaceOfPackage() {
|
public void testPackage() {
|
||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ public final class KotlinLibTest extends SingleFileTranslationTest {
|
|||||||
super("kotlinLib/");
|
super("kotlinLib/");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespaceHasDeclaredFunction() throws Exception {
|
public void testPackageHasDeclaredFunction() throws Exception {
|
||||||
runJavascriptTest("namespace.js");
|
runJavascriptTest("package.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testNamespaceHasDeclaredClasses() throws Exception {
|
public void testPackageHasDeclaredClasses() throws Exception {
|
||||||
runJavascriptTest("namespaceWithClasses.js");
|
runJavascriptTest("packageWithClasses.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ public final class MiscTest extends AbstractExpressionTest {
|
|||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassWithoutNamespace() throws Exception {
|
public void testClassWithoutPackage() throws Exception {
|
||||||
runFunctionOutputTest("classWithoutNamespace.kt", Namer.getRootPackageName(), "box", true);
|
runFunctionOutputTest("classWithoutPackage.kt", Namer.getRootPackageName(), "box", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIfElseAsExpressionWithThrow() throws Exception {
|
public void testIfElseAsExpressionWithThrow() throws Exception {
|
||||||
@@ -103,15 +103,15 @@ public final class MiscTest extends AbstractExpressionTest {
|
|||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespacePropertyCalledAsFun() throws Exception {
|
public void testPackagePropertyCalledAsFun() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExtensionLiteralCreatedAtNamespaceLevel() throws Exception {
|
public void testExtensionLiteralCreatedAtPackageLevel() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testTemporaryVariableCreatedInNamespaceInitializer() throws Exception {
|
public void testTemporaryVariableCreatedInPackageInitializer() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,8 +131,8 @@ public final class MiscTest extends AbstractExpressionTest {
|
|||||||
checkFooBoxIsTrue("KT-1865.kt");
|
checkFooBoxIsTrue("KT-1865.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMainFunInNestedNamespace() throws Exception {
|
public void testMainFunInNestedPackage() throws Exception {
|
||||||
checkOutput("mainFunInNestedNamespace.kt", "ayee");
|
checkOutput("mainFunInNestedPackage.kt", "ayee");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -149,14 +149,14 @@ public final class MiscTest extends AbstractExpressionTest {
|
|||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespaceLevelVarInPackage() throws Exception {
|
public void testPackageLevelVarInPackage() throws Exception {
|
||||||
fooBoxIsValue("OK");
|
fooBoxIsValue("OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: see http://youtrack.jetbrains.com/issue/KT-2564
|
//TODO: see http://youtrack.jetbrains.com/issue/KT-2564
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
public void TODO_testNamespaceLevelVarInRoot() throws Exception {
|
public void TODO_testPackageLevelVarInRoot() throws Exception {
|
||||||
runFunctionOutputTest("namespaceLevelVarInRoot.kt", Namer.getRootPackageName(), "box", "OK");
|
runFunctionOutputTest("packageLevelVarInRoot.kt", Namer.getRootPackageName(), "box", "OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLazyPropertyGetterNotCalledOnStart() throws Exception {
|
public void testLazyPropertyGetterNotCalledOnStart() throws Exception {
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2013 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.k2js.test.semantics;
|
|
||||||
|
|
||||||
import org.jetbrains.k2js.test.MultipleFilesTranslationTest;
|
|
||||||
|
|
||||||
public class MultiNamespaceTest extends MultipleFilesTranslationTest {
|
|
||||||
|
|
||||||
|
|
||||||
public MultiNamespaceTest() {
|
|
||||||
super("multiNamespace/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionsVisibleFromOtherNamespace() throws Exception {
|
|
||||||
checkFooBoxIsTrue("functionsVisibleFromOtherNamespace");
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: fails on centos-1 build agent, can't reproduce
|
|
||||||
public void TODO_testClassesInheritedFromOtherNamespace() throws Exception {
|
|
||||||
checkFooBoxIsTrue("classesInheritedFromOtherNamespace");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testNamespaceVariableVisibleFromOtherNamespace() throws Exception {
|
|
||||||
checkFooBoxIsTrue("namespaceVariableVisibleFromOtherNamespace");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testNestedNamespaceFunctionCalledFromOtherNamespace() throws Exception {
|
|
||||||
runMultiFileTest("nestedNamespaceFunctionCalledFromOtherNamespace", "a.foo", "box", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSubnamespacesWithClashingNames() throws Exception {
|
|
||||||
runMultiFileTest("subnamespacesWithClashingNames", "a.foo", "box", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSubnamespacesWithClashingNamesUsingImport() throws Exception {
|
|
||||||
runMultiFileTest("subnamespacesWithClashingNamesUsingImport", "a.foo", "box", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testCreateClassFromOtherNamespace() throws Exception {
|
|
||||||
runMultiFileTest("createClassFromOtherNamespace", "a.foo", "box", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testCreateClassFromOtherNamespaceUsingImport() throws Exception {
|
|
||||||
runMultiFileTest("createClassFromOtherNamespaceUsingImport", "a.foo", "box", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2013 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.k2js.test.semantics;
|
||||||
|
|
||||||
|
import org.jetbrains.k2js.test.MultipleFilesTranslationTest;
|
||||||
|
|
||||||
|
public class MultiPackageTest extends MultipleFilesTranslationTest {
|
||||||
|
|
||||||
|
|
||||||
|
public MultiPackageTest() {
|
||||||
|
super("multiPackage/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testFunctionsVisibleFromOtherPackage() throws Exception {
|
||||||
|
checkFooBoxIsTrue("functionsVisibleFromOtherPackage");
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: fails on centos-1 build agent, can't reproduce
|
||||||
|
public void TODO_testClassesInheritedFromOtherPackage() throws Exception {
|
||||||
|
checkFooBoxIsTrue("classesInheritedFromOtherPackage");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testPackageVariableVisibleFromOtherPackage() throws Exception {
|
||||||
|
checkFooBoxIsTrue("PackageVariableVisibleFromOtherPackage");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testNestedPackageFunctionCalledFromOtherPackage() throws Exception {
|
||||||
|
runMultiFileTest("nestedPackageFunctionCalledFromOtherPackage", "a.foo", "box", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testSubPackagesWithClashingNames() throws Exception {
|
||||||
|
runMultiFileTest("subPackagesWithClashingNames", "a.foo", "box", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testSubPackagesWithClashingNamesUsingImport() throws Exception {
|
||||||
|
runMultiFileTest("subPackagesWithClashingNamesUsingImport", "a.foo", "box", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCreateClassFromOtherPackage() throws Exception {
|
||||||
|
runMultiFileTest("createClassFromOtherPackage", "a.foo", "box", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCreateClassFromOtherPackageUsingImport() throws Exception {
|
||||||
|
runMultiFileTest("createClassFromOtherPackageUsingImport", "a.foo", "box", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2013 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.k2js.test.semantics;
|
|
||||||
|
|
||||||
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
|
||||||
|
|
||||||
public final class NamespaceTest extends SingleFileTranslationTest {
|
|
||||||
public NamespaceTest() {
|
|
||||||
super("namespace/");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testNestedNamespace() throws Exception {
|
|
||||||
runFunctionOutputTest("nestedNamespace.kt", "foo.bar", "box", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDeeplyNestedNamespace() throws Exception {
|
|
||||||
runFunctionOutputTest("deeplyNestedNamespace.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDeeplyNestedNamespaceFunctionCalled() throws Exception {
|
|
||||||
runFunctionOutputTest("deeplyNestedNamespaceFunctionCalled.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testClassCreatedInDeeplyNestedNamespace() throws Exception {
|
|
||||||
runFunctionOutputTest("classCreatedInDeeplyNestedNamespace.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testInitializersOfNestedNamespacesExecute() throws Exception {
|
|
||||||
runFunctionOutputTest("initializersOfNestedNamespacesExecute.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2013 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.k2js.test.semantics;
|
||||||
|
|
||||||
|
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
||||||
|
|
||||||
|
public final class PackageTest extends SingleFileTranslationTest {
|
||||||
|
public PackageTest() {
|
||||||
|
super("package/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testNestedPackage() throws Exception {
|
||||||
|
runFunctionOutputTest("nestedPackage.kt", "foo.bar", "box", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testDeeplyNestedPackage() throws Exception {
|
||||||
|
runFunctionOutputTest("deeplyNestedPackage.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testDeeplyNestedPackageFunctionCalled() throws Exception {
|
||||||
|
runFunctionOutputTest("deeplyNestedPackageFunctionCalled.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testClassCreatedInDeeplyNestedPackage() throws Exception {
|
||||||
|
runFunctionOutputTest("classCreatedInDeeplyNestedPackage.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testInitializersOfNestedPackagesExecute() throws Exception {
|
||||||
|
runFunctionOutputTest("initializersOfNestedPackagesExecute.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -56,21 +56,21 @@ public final class PropertyAccessTest extends SingleFileTranslationTest {
|
|||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespacePropertyInitializer() throws Exception {
|
public void testPackagePropertyInitializer() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testNamespacePropertySet() throws Exception {
|
public void testPackagePropertySet() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNamespaceCustomAccessors() throws Exception {
|
public void testPackageCustomAccessors() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testClassUsesNamespaceProperties() throws Exception {
|
public void testClassUsesPackageProperties() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.io.*
|
|||||||
* Represents a generic API to templates which should be usable
|
* Represents a generic API to templates which should be usable
|
||||||
* in JavaScript in a browser or on the server side stand alone or in a web app etc.
|
* in JavaScript in a browser or on the server side stand alone or in a web app etc.
|
||||||
*
|
*
|
||||||
* To make things easier to implement in JS this namespace won't refer to any java.io or servlet
|
* To make things easier to implement in JS this package won't refer to any java.io or servlet
|
||||||
* stuff
|
* stuff
|
||||||
*/
|
*/
|
||||||
trait Template {
|
trait Template {
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ class KModel(val context: BindingContext, val config: KDocConfig, val sourceDirs
|
|||||||
if (packageFragment != null) {
|
if (packageFragment != null) {
|
||||||
allPackageFragments.add(packageFragment);
|
allPackageFragments.add(packageFragment);
|
||||||
} else {
|
} else {
|
||||||
warning("No NamespaceDescriptor for source $source")
|
warning("No PackageFragmentDescriptor for source $source")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val allClasses = HashSet<KClass>()
|
val allClasses = HashSet<KClass>()
|
||||||
@@ -847,7 +847,7 @@ class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate
|
|||||||
|
|
||||||
protected fun findWritableScope(declarationDescriptor: DeclarationDescriptor) : WritableScopeImpl? {
|
protected fun findWritableScope(declarationDescriptor: DeclarationDescriptor) : WritableScopeImpl? {
|
||||||
val container = declarationDescriptor.getContainingDeclaration()
|
val container = declarationDescriptor.getContainingDeclaration()
|
||||||
if (container is NamespaceDescriptor) {
|
if (container is PackageFragmentDescriptor) {
|
||||||
val scope = container.getMemberScope()
|
val scope = container.getMemberScope()
|
||||||
if (scope is WritableScopeImpl) {
|
if (scope is WritableScopeImpl) {
|
||||||
return scope
|
return scope
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user