DM 19.09.2016: typealiases private in file are resolved as classes.
Add test for typealias private in file.
This commit is contained in:
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.resolve
|
||||
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.impl.TypeAliasConstructorDescriptor
|
||||
import org.jetbrains.kotlin.diagnostics.Errors
|
||||
import org.jetbrains.kotlin.idea.MainFunctionDetector
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// FILE: file1.kt
|
||||
private class <!REDECLARATION!>C<!> {
|
||||
companion object
|
||||
}
|
||||
|
||||
private typealias <!REDECLARATION!>TA<!> = C
|
||||
|
||||
private val test1: C = C()
|
||||
private val test1co: C.Companion = C
|
||||
|
||||
private val test2: TA = TA()
|
||||
private val test2co = TA
|
||||
|
||||
// FILE: file2.kt
|
||||
private val test1: <!INVISIBLE_REFERENCE!>C<!> = <!INVISIBLE_MEMBER!>C<!>()
|
||||
private val test1co: <!INVISIBLE_REFERENCE!>C<!>.<!INVISIBLE_REFERENCE!>Companion<!> = <!INVISIBLE_MEMBER!>C<!>
|
||||
|
||||
private val test2: <!INVISIBLE_REFERENCE!>TA<!> = <!INVISIBLE_MEMBER!>TA<!>()
|
||||
private val test2co = <!INVISIBLE_MEMBER!>TA<!>
|
||||
|
||||
private class <!REDECLARATION!>C<!>
|
||||
private typealias <!REDECLARATION!>TA<!> = Int
|
||||
@@ -0,0 +1,33 @@
|
||||
package
|
||||
|
||||
private val test1: C
|
||||
private val test1: C
|
||||
private val test1co: C.Companion
|
||||
private val test1co: C.Companion
|
||||
private val test2: TA /* = C */
|
||||
private val test2: TA /* = C */
|
||||
private val test2co: C.Companion
|
||||
private val test2co: C.Companion
|
||||
|
||||
private final class C {
|
||||
public constructor C()
|
||||
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
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
private final class C {
|
||||
public constructor C()
|
||||
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
|
||||
}
|
||||
private typealias TA = C
|
||||
private typealias TA = kotlin.Int
|
||||
@@ -20382,6 +20382,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("privateInFile.kt")
|
||||
public void testPrivateInFile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/privateInFile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("projectionsInTypeAliasConstructor.kt")
|
||||
public void testProjectionsInTypeAliasConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.kt");
|
||||
@@ -20454,18 +20460,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasInvisibleObject.kt")
|
||||
public void testTypeAliasInvisibleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasInvisibleObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasNotNull.kt")
|
||||
public void testTypeAliasNotNull() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasConstructorInSuperCall.kt")
|
||||
public void testTypeAliasConstructorInSuperCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasConstructorInSuperCall.kt");
|
||||
@@ -20484,6 +20478,18 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasInvisibleObject.kt")
|
||||
public void testTypeAliasInvisibleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasInvisibleObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasNotNull.kt")
|
||||
public void testTypeAliasNotNull() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasObject.kt")
|
||||
public void testTypeAliasObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasObject.kt");
|
||||
|
||||
Reference in New Issue
Block a user