Resolution: Resolve primary constructor references to primary constructor

itself if it's explicitly present in PSI
This commit is contained in:
Alexey Sedunov
2015-06-04 16:26:47 +03:00
parent b049455aa4
commit 608ce59f15
15 changed files with 36 additions and 23 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
~A~class A {
~B~class B() {
~B()~constructor(i: Int) {}
~B~class B~B()~() {
~B(int)~constructor(i: Int) {}
}
~foo~fun foo(~foo.a~a : `kotlin::Char`Char) = `foo.a`a`:kotlin::Char`
~fooB~fun fooB() = `foo`foo('1')`:kotlin::Char`
~foo.1~fun foo() : Int = (1.`kotlin::Int.plus(Int)`plus(1))`:kotlin::Int`
~foo91~fun foo1() : `B`B = `B`B()`:B`
~foo91~fun foo1() : `B`B = `B()`B()`:B`
~A.a~val a : `kotlin::Int`Int
}
@@ -1,7 +1,7 @@
// FILE: base.kt
class java {
class lang {
class ~Fake~Fake()
class ~Fake~Fake~Fake()~()
}
}
@@ -9,13 +9,13 @@ class java {
import java.lang.* // will import Fake
fun foo() {
`Fake`Fake()
`Fake()`Fake()
}
// FILE: root2.kt
fun foo() {
`!`Fake() // not imported within "java.lang.*" default import
java.lang.`Fake`Fake() // we all are in same (root) package, so it works
java.lang.`Fake()`Fake() // we all are in same (root) package, so it works
}
@@ -24,6 +24,6 @@ package nonRoot
import java.lang.* // will import Fake
fun foo() {
`Fake`Fake()
`Fake()`Fake()
java.lang.`!`Fake() // qualified access to root package's class does not work
}
+2 -2
View File
@@ -9,7 +9,7 @@ fun foo(~a~a : `kotlin::Array`Array<`kotlin::Int`Int>) : `java::java.util.ArrayL
fun foo(o : `java::java.lang.Object`Object, l : `java::java.util`util.`java::java.util.ArrayList`ArrayList) : `java::java.util.ArrayList`ArrayList {}
~A~class A() {
~A~class A~A()~() {
fun f(a : `java::java.util`util.`java::java.util.ArrayList`ArrayList) {}
fun f(a : `java::java.util.ArrayList`ArrayList) {}
@@ -29,7 +29,7 @@ class B : `java::java.lang.Object`Object {
}
fun barrr() : `kotlin::Int`Int {
`foo`foo(`A`A())
`foo`foo(`A()`A())
}
}
+2 -2
View File
@@ -1,9 +1,9 @@
var xxxx = 1
~SimpleClass~class SimpleClass(x : Int) {
~SimpleClass~class SimpleClass~SimpleClass()~(x : Int) {
fun foo() = x
}
fun foo() {
`SimpleClass`SimpleClass(1).`!`xxxx
`SimpleClass()`SimpleClass(1).`!`xxxx
}