Do not add special names to scopes #KT-14319 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-10-13 12:35:00 +03:00
parent 7263109413
commit 7a41d13b41
6 changed files with 35 additions and 2 deletions
@@ -57,6 +57,8 @@ abstract class LexicalScopeStorage(
val name = descriptor.name
val descriptorIndex = addDescriptor(descriptor)
if (name.isSpecial) return
if (variablesAndClassifiersByName == null) {
variablesAndClassifiersByName = HashMap()
}
@@ -6,4 +6,4 @@ data class A2(val <!REDECLARATION!>x<!>: Int, val y: String) {
val <!REDECLARATION!>x<!> = ""
}
data class A3(<!REDECLARATION, REDECLARATION, REDECLARATION!>val<!SYNTAX!><!> :Int<!>, <!REDECLARATION, REDECLARATION, REDECLARATION!>val<!SYNTAX!><!> : Int<!>)
data class A3(<!REDECLARATION!>val<!SYNTAX!><!> :Int<!>, <!REDECLARATION!>val<!SYNTAX!><!> : Int<!>)
+1 -1
View File
@@ -1,2 +1,2 @@
// !DIAGNOSTICS: -NO_VALUE_FOR_PARAMETER
class Tree<<!REDECLARATION!>T<!>>(T <!SYNTAX!>element<!>, <!REDECLARATION, REDECLARATION!><!SYNTAX!><!>Tree<T><!><!SYNTAX!><!> left<!SYNTAX!><!>, <!REDECLARATION, REDECLARATION!><!SYNTAX!><!>Tree<T><!><!SYNTAX!><!> right<!SYNTAX!><!>) {}
class Tree<<!REDECLARATION!>T<!>>(T <!SYNTAX!>element<!>, <!SYNTAX!><!>Tree<T><!SYNTAX!><!> left<!SYNTAX!><!>, <!SYNTAX!><!>Tree<T><!SYNTAX!><!> right<!SYNTAX!><!>) {}
@@ -0,0 +1,10 @@
data class XY(val x: Int, val y: Int)
fun foo(list: List<XY>) {
for ((x1, y1) in list) {
for ((x2, y2) in list) {
if (x1 == y2 && x2 == y1) return
}
list.map { (x3, y3) -> x3 + y3 }
}
}
@@ -0,0 +1,15 @@
package
public fun foo(/*0*/ list: kotlin.collections.List<XY>): kotlin.Unit
public final data class XY {
public constructor XY(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int)
public final val x: kotlin.Int
public final val y: kotlin.Int
public final operator /*synthesized*/ fun component1(): kotlin.Int
public final operator /*synthesized*/ fun component2(): kotlin.Int
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): XY
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
@@ -161,6 +161,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName);
}
@TestMetadata("shadowingInDestructuring.kt")
public void testShadowingInDestructuring() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)