KT-2752: fixes after code review

This commit is contained in:
Alexey Andreev
2016-09-20 16:03:33 +03:00
parent 00867cb269
commit 6f7e7d8504
30 changed files with 380 additions and 138 deletions
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.resolve.calls.results.isSignatureNotLessSpecific
import org.jetbrains.kotlin.resolve.calls.tower.getTypeAliasConstructors
import org.jetbrains.kotlin.resolve.descriptorUtil.hasLowPriorityInOverloadResolution
import org.jetbrains.kotlin.resolve.descriptorUtil.varargParameterPosition
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtensionProperty
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.types.ErrorUtils
import org.jetbrains.kotlin.types.KotlinType
@@ -80,14 +81,10 @@ class OverloadChecker(val specificityComparator: TypeSpecificityComparator) {
EXTENSION_PROPERTY
}
private fun DeclarationDescriptor.isExtensionProperty() =
this is PropertyDescriptor &&
extensionReceiverParameter != null
private fun getDeclarationCategory(a: DeclarationDescriptor): DeclarationCategory =
when (a) {
is PropertyDescriptor ->
if (a.isExtensionProperty())
if (a.isExtensionProperty)
DeclarationCategory.EXTENSION_PROPERTY
else
DeclarationCategory.TYPE_OR_VALUE
@@ -0,0 +1,5 @@
package foo
class <!JS_NAME_CLASH!>A(val x: Int)<!>
<!JS_NAME_CLASH!>fun A()<!> {}
@@ -0,0 +1,13 @@
package
package foo {
public fun A(): kotlin.Unit
public final class A {
public constructor A(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
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
}
}
@@ -12,7 +12,7 @@ class C : A, B {
<!JS_NAME_CLASH!>override fun g()<!> {}
}
abstract class <!JS_NAME_CLASH_SYNTHETIC!>D<!> : A, B
abstract class <!JS_FAKE_NAME_CLASH!>D<!> : A, B
open class E {
open fun f() {}
@@ -20,4 +20,4 @@ open class E {
open fun g() {}
}
class <!JS_NAME_CLASH_SYNTHETIC!>F<!> : E(), A, B
class <!JS_FAKE_NAME_CLASH!>F<!> : E(), A, B
@@ -6,8 +6,8 @@ class A {
set(value) {}
<!JS_NAME_IS_NOT_ON_ALL_ACCESSORS!>var y: Int<!>
@JsName("get_y") get() = 23
set(value) {}
get() = 23
@JsName("set_y") set(value) {}
var z: Int
@JsName("get_z") get() = 23
@@ -295,6 +295,12 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib/name"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("classAndFunction.kt")
public void testClassAndFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/name/classAndFunction.kt");
doTest(fileName);
}
@TestMetadata("classLevelMethodAndProperty.kt")
public void testClassLevelMethodAndProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/name/classLevelMethodAndProperty.kt");