Redeclaration errors for type aliases: type alias vs property.

This commit is contained in:
Dmitry Petrov
2016-06-09 12:17:54 +03:00
parent 9470308fe7
commit 5ad4c8b9c7
3 changed files with 36 additions and 0 deletions
@@ -0,0 +1,15 @@
// FILE: file1.kt
typealias <!REDECLARATION!>Test<!> = String
val <!REDECLARATION!>Test<!> = 42
class Outer {
typealias <!REDECLARATION!>Test<!> = String
val <!REDECLARATION!>Test<!> = 42
}
typealias <!REDECLARATION!>Test2<!> = String
// FILE: file2.kt
val <!REDECLARATION!>Test2<!> = 42
@@ -0,0 +1,15 @@
package
public typealias Test = kotlin.String
public typealias Test2 = kotlin.String
public val Test: kotlin.Int = 42
public val Test2: kotlin.Int = 42
public final class Outer {
public typealias Test = kotlin.String
public constructor Outer()
public final val Test: kotlin.Int = 42
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
}
@@ -13908,6 +13908,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("TypeAliasVsProperty.kt")
public void testTypeAliasVsProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/redeclarations/TypeAliasVsProperty.kt");
doTest(fileName);
}
@TestMetadata("typeParameterWithTwoBounds.kt")
public void testTypeParameterWithTwoBounds() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt");