Don't load Object as a supertype for Java classes
#KT-4890 In Progress #KT-5002 Fixed
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
public open class Test(): java.util.RandomAccess, Cloneable, java.io.Serializable
|
||||
{
|
||||
public override fun clone(): Test = Test() // Override 'clone()' with more precise type 'Test'
|
||||
public fun clone(): Test = Test() // Override 'clone()' with more precise type 'Test'
|
||||
|
||||
public override fun toString() = "OK"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fun box(): String {
|
||||
val f = { }
|
||||
val class1 = Runnable(f).getClass()
|
||||
val class2 = Runnable(f).getClass()
|
||||
val class1 = (Runnable(f) as Object).getClass()
|
||||
val class2 = (Runnable(f) as Object).getClass()
|
||||
|
||||
return if (class1 == class2) "OK" else "$class1 $class2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fun box(): String {
|
||||
val f = { }
|
||||
val class1 = Runnable(f).getClass()
|
||||
val class2 = Custom.Runnable(f).getClass()
|
||||
val class1 = Runnable(f).javaClass
|
||||
val class2 = Custom.Runnable(f).javaClass
|
||||
|
||||
return if (class1 != class2) "OK" else "Same class: $class1"
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import java.util.Arrays
|
||||
|
||||
fun box(): String {
|
||||
val r: JavaClass.Computable<String> = JavaClass.Computable { "OK" }
|
||||
val supertypes = Arrays.toString(r.getClass().getGenericInterfaces())
|
||||
val supertypes = Arrays.toString(r.javaClass.getGenericInterfaces())
|
||||
if (supertypes != "[JavaClass.JavaClass\$Computable<java.lang.String>]") return "Fail: $supertypes"
|
||||
return JavaClass.compute(r)!!
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun box(): String {
|
||||
val class1 = getWrapped1().getClass()
|
||||
val class2 = getWrapped2().getClass()
|
||||
val class1 = getWrapped1().javaClass
|
||||
val class2 = getWrapped2().javaClass
|
||||
|
||||
return if (class1 != class2) "OK" else "Same class: $class1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.io.Serializable
|
||||
|
||||
public data class Pair<out A, out B> (
|
||||
public val first: A,
|
||||
public val second: B
|
||||
) : Serializable
|
||||
|
||||
fun box(): String {
|
||||
val p = Pair(42, "OK")
|
||||
val q = Pair(42, "OK")
|
||||
if (p != q) return "Fail equals"
|
||||
if (p.hashCode() != q.hashCode()) return "Fail hashCode"
|
||||
if (p.toString() != q.toString()) return "Fail toString"
|
||||
return p.second
|
||||
}
|
||||
@@ -15,7 +15,6 @@ public class Y extends X<A> {
|
||||
// FILE: test.kt
|
||||
|
||||
fun main() {
|
||||
Y().foo()<!UNSAFE_CALL!>.<!>wait()
|
||||
Y().foo()<!UNSAFE_CALL!>.<!>hashCode()
|
||||
Y().bar(null)
|
||||
}
|
||||
|
||||
|
||||
+1
-9
@@ -1,16 +1,8 @@
|
||||
package test
|
||||
|
||||
public final class ClassWithObjectMethod : java.lang.Object {
|
||||
public final class ClassWithObjectMethod {
|
||||
public constructor ClassWithObjectMethod()
|
||||
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun getClass(): java.lang.Class<out kotlin.Any?>
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun notify(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun notifyAll(): kotlin.Unit
|
||||
public open override /*1*/ fun toString(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun wait(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun wait(/*0*/ p0: kotlin.Long): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun wait(/*0*/ p0: kotlin.Long, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
+3
-9
@@ -1,15 +1,9 @@
|
||||
package test
|
||||
|
||||
public trait InterfaceWithObjectMethods : java.lang.Object {
|
||||
public abstract override /*1*/ fun clone(): kotlin.Any
|
||||
public trait InterfaceWithObjectMethods {
|
||||
public abstract fun clone(): kotlin.Any?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract override /*1*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun getClass(): java.lang.Class<out kotlin.Any?>
|
||||
public abstract fun finalize(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun notify(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun notifyAll(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun wait(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun wait(/*0*/ p0: kotlin.Long): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun wait(/*0*/ p0: kotlin.Long, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ public final class Sub : test.Super {
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun foo(/*0*/ r: java.lang.Runnable?): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class Super : java.lang.Object {
|
||||
public open class Super {
|
||||
public constructor Super()
|
||||
public/*package*/ final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)?): kotlin.Unit
|
||||
public/*package*/ final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)?): kotlin.Unit
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ public final class Sub : test.Super {
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun foo(/*0*/ r: java.lang.Runnable?): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class Super : java.lang.Object {
|
||||
public open class Super {
|
||||
public constructor Super()
|
||||
public/*package*/ final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)?): kotlin.Unit
|
||||
public/*package*/ open fun foo(/*0*/ r: java.lang.Runnable?): kotlin.Unit
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ public final class Sub : test.Super {
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun foo(/*0*/ r: java.lang.Runnable?): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class Super : java.lang.Object {
|
||||
public open class Super {
|
||||
public constructor Super()
|
||||
public/*package*/ final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)?): kotlin.Unit
|
||||
public/*package*/ open fun foo(/*0*/ r: java.lang.Runnable?): kotlin.Unit
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
public open class Base : java.lang.Object {
|
||||
public open class Base {
|
||||
public constructor Base()
|
||||
public/*package*/ open fun foo(): kotlin.Unit
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
public open class Base : java.lang.Object {
|
||||
public open class Base {
|
||||
public constructor Base()
|
||||
protected/*protected and package*/ open fun foo(): kotlin.Unit
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public final class InheritJavaField : test.Super {
|
||||
public open override /*1*/ /*fake_override*/ fun method(): kotlin.Int
|
||||
}
|
||||
|
||||
public open class Super : java.lang.Object {
|
||||
public open class Super {
|
||||
public constructor Super()
|
||||
public final var field: kotlin.Int
|
||||
private final var privateField: kotlin.Int
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package test
|
||||
|
||||
public /*synthesized*/ fun A(/*0*/ function: (kotlin.Int) -> kotlin.Unit): test.A
|
||||
|
||||
public trait A : java.lang.Object {
|
||||
public trait A {
|
||||
public abstract fun foo(/*0*/ p0: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package test
|
||||
|
||||
public /*synthesized*/ fun J(/*0*/ function: (test.K?) -> kotlin.Unit): test.J
|
||||
|
||||
public trait J : java.lang.Object {
|
||||
public trait J {
|
||||
public abstract fun foo(/*0*/ p0: test.K?): kotlin.Unit
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait ErrorTypes : java.lang.Object {
|
||||
|
||||
public trait ErrorTypes {
|
||||
|
||||
public trait Sub : test.ErrorTypes.Super {
|
||||
public abstract fun errorTypeInParameter(/*0*/ list: kotlin.List<kotlin.Array<[ERROR : Unresolved java classifier: T]>?>?): kotlin.Unit
|
||||
public abstract override /*1*/ /*fake_override*/ fun errorTypeInParameter(/*0*/ list: kotlin.List<kotlin.Array<[ERROR : Unresolved java classifier: T]>?>?): kotlin.Unit
|
||||
public abstract override /*1*/ fun returnErrorType(): [ERROR : Unresolved java classifier: T]?
|
||||
}
|
||||
|
||||
public trait Super : java.lang.Object {
|
||||
|
||||
public trait Super {
|
||||
public abstract fun errorTypeInParameter(/*0*/ list: kotlin.List<kotlin.Array<[ERROR : Unresolved java classifier: T]>?>?): kotlin.Unit
|
||||
public abstract fun returnErrorType(): [ERROR : Unresolved java classifier: T]?
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package test
|
||||
|
||||
public /*synthesized*/ fun NullInAnnotation(/*0*/ function: () -> kotlin.Unit): test.NullInAnnotation
|
||||
|
||||
public trait NullInAnnotation : java.lang.Object {
|
||||
public trait NullInAnnotation {
|
||||
test.NullInAnnotation.Ann(a = null: kotlin.Nothing?, b = {null}: kotlin.Array<kotlin.String>) public abstract fun foo(): kotlin.Unit
|
||||
|
||||
|
||||
public final annotation class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ a: kotlin.String, /*1*/ vararg b: kotlin.String /*kotlin.Array<kotlin.String>*/)
|
||||
public abstract fun a(): kotlin.String
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait ReturnInnerSubclassOfSupersInner : java.lang.Object {
|
||||
|
||||
public trait ReturnInnerSubclassOfSupersInner {
|
||||
|
||||
public open class Sub</*0*/ B> : test.ReturnInnerSubclassOfSupersInner.Super<B> {
|
||||
public constructor Sub</*0*/ B>()
|
||||
|
||||
|
||||
public/*package*/ open inner class Inner : test.ReturnInnerSubclassOfSupersInner.Super.Inner {
|
||||
public/*package*/ constructor Inner()
|
||||
public/*package*/ open override /*1*/ fun get(): test.ReturnInnerSubclassOfSupersInner.Sub<B>?
|
||||
}
|
||||
}
|
||||
|
||||
public open class Super</*0*/ A> : java.lang.Object {
|
||||
|
||||
public open class Super</*0*/ A> {
|
||||
public constructor Super</*0*/ A>()
|
||||
|
||||
public/*package*/ open inner class Inner : java.lang.Object {
|
||||
|
||||
public/*package*/ open inner class Inner {
|
||||
public/*package*/ constructor Inner()
|
||||
public/*package*/ open fun get(): test.ReturnInnerSubclassOfSupersInner.Super<A>?
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package test
|
||||
|
||||
public trait ReturnNotSubtype : java.lang.Object {
|
||||
|
||||
public trait ReturnNotSubtype {
|
||||
|
||||
public trait Sub : test.ReturnNotSubtype.Super<kotlin.Boolean> {
|
||||
public abstract override /*1*/ fun _void(): kotlin.Boolean
|
||||
public abstract override /*1*/ fun array(): kotlin.Array<java.lang.Void>?
|
||||
@@ -10,8 +10,8 @@ public trait ReturnNotSubtype : java.lang.Object {
|
||||
public abstract override /*1*/ fun string2(): kotlin.MutableList<kotlin.Boolean>?
|
||||
public abstract override /*1*/ fun t(): java.lang.Void?
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
|
||||
public trait Super</*0*/ T> {
|
||||
public abstract fun _void(): kotlin.Unit
|
||||
public abstract fun array(): kotlin.Array<T>?
|
||||
public abstract fun klass(): java.lang.Class<out kotlin.CharSequence?>?
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package test
|
||||
|
||||
public trait WrongNumberOfGenericParameters : java.lang.Object {
|
||||
public trait WrongNumberOfGenericParameters {
|
||||
public abstract fun o0(): test.WrongNumberOfGenericParameters.One<out kotlin.Any?>?
|
||||
public abstract fun o2(): test.WrongNumberOfGenericParameters.One<[ERROR : T]>?
|
||||
public abstract fun t1(): test.WrongNumberOfGenericParameters.Two<out kotlin.Any?, out kotlin.Any?>?
|
||||
public abstract fun z(): test.WrongNumberOfGenericParameters.Zero?
|
||||
|
||||
public trait One</*0*/ T> : java.lang.Object {
|
||||
|
||||
public trait One</*0*/ T> {
|
||||
}
|
||||
|
||||
public trait Two</*0*/ P, /*1*/ Q> : java.lang.Object {
|
||||
|
||||
public trait Two</*0*/ P, /*1*/ Q> {
|
||||
}
|
||||
|
||||
public trait Zero : java.lang.Object {
|
||||
|
||||
public trait Zero {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
null
|
||||
>>> val s = ByteArrayOutputStream()
|
||||
null
|
||||
>>> s.getClass()!!.getName()
|
||||
>>> s.javaClass!!.getName()
|
||||
java.io.ByteArrayOutputStream
|
||||
|
||||
+5
@@ -613,6 +613,11 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/dataClasses/genericParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt5002.kt")
|
||||
public void testKt5002() throws Exception {
|
||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/dataClasses/kt5002.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixedParams.kt")
|
||||
public void testMixedParams() throws Exception {
|
||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/dataClasses/mixedParams.kt");
|
||||
|
||||
+10
-26
@@ -44,12 +44,9 @@ import org.jetbrains.jet.lang.descriptors.annotations.Annotations
|
||||
import org.jetbrains.jet.lang.descriptors.ClassKind
|
||||
import java.util.ArrayList
|
||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker
|
||||
import org.jetbrains.jet.lang.resolve.java.resolver.DescriptorResolverUtils
|
||||
import org.jetbrains.jet.lang.resolve.java.descriptor.JavaClassStaticsPackageFragmentDescriptor
|
||||
import org.jetbrains.jet.lang.types.AbstractClassTypeConstructor
|
||||
import org.jetbrains.jet.lang.resolve.java.lazy.resolveTopLevelClassInModule
|
||||
import org.jetbrains.jet.lang.descriptors.impl.EnumClassObjectDescriptor
|
||||
import org.jetbrains.jet.lang.descriptors.SourceElement
|
||||
|
||||
class LazyJavaClassDescriptor(
|
||||
private val outerC: LazyJavaResolverContextWithTypes,
|
||||
@@ -174,29 +171,16 @@ class LazyJavaClassDescriptor(
|
||||
override fun getParameters(): List<TypeParameterDescriptor> = _parameters()
|
||||
|
||||
private val _supertypes = c.storageManager.createLazyValue<Collection<JetType>> {
|
||||
val supertypes = jClass.getSupertypes()
|
||||
if (supertypes.isEmpty()) {
|
||||
val objectFqName = DescriptorResolverUtils.OBJECT_FQ_NAME
|
||||
if (jClass.getFqName() == objectFqName) {
|
||||
listOf(KotlinBuiltIns.getInstance().getAnyType())
|
||||
}
|
||||
else {
|
||||
val objectType = c.resolveTopLevelClassInModule(objectFqName)?.getDefaultType()
|
||||
// If java.lang.Object is not found, we simply use Any to recover
|
||||
listOf(objectType ?: KotlinBuiltIns.getInstance().getAnyType())
|
||||
}
|
||||
}
|
||||
else
|
||||
supertypes.stream()
|
||||
.map {
|
||||
supertype ->
|
||||
c.typeResolver.transformJavaType(supertype, TypeUsage.SUPERTYPE.toAttributes())
|
||||
}
|
||||
.filter { supertype -> !supertype.isError() }
|
||||
.toList()
|
||||
.ifEmpty {
|
||||
listOf(KotlinBuiltIns.getInstance().getAnyType())
|
||||
}
|
||||
jClass.getSupertypes().stream()
|
||||
.map {
|
||||
supertype ->
|
||||
c.typeResolver.transformJavaType(supertype, TypeUsage.SUPERTYPE.toAttributes())
|
||||
}
|
||||
.filter { supertype -> !supertype.isError() }
|
||||
.toList()
|
||||
.ifEmpty {
|
||||
listOf(KotlinBuiltIns.getInstance().getAnyType())
|
||||
}
|
||||
}
|
||||
|
||||
override fun getSupertypes(): Collection<JetType> = _supertypes()
|
||||
|
||||
-2
@@ -37,8 +37,6 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import java.util.*;
|
||||
|
||||
public final class DescriptorResolverUtils {
|
||||
public static final FqName OBJECT_FQ_NAME = new FqName("java.lang.Object");
|
||||
|
||||
private DescriptorResolverUtils() {
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -331,6 +331,8 @@ public class SingleAbstractMethodUtils {
|
||||
}
|
||||
|
||||
private static class OnlyAbstractMethodFinder {
|
||||
private static final FqName OBJECT_FQ_NAME = new FqName("java.lang.Object");
|
||||
|
||||
private JavaMethod foundMethod;
|
||||
private JavaTypeSubstitutor foundClassSubstitutor;
|
||||
|
||||
@@ -342,7 +344,7 @@ public class SingleAbstractMethodUtils {
|
||||
}
|
||||
assert classifier instanceof JavaClass : "Classifier should be a class here: " + classifier;
|
||||
JavaClass javaClass = (JavaClass) classifier;
|
||||
if (DescriptorResolverUtils.OBJECT_FQ_NAME.equals(javaClass.getFqName())) {
|
||||
if (OBJECT_FQ_NAME.equals(javaClass.getFqName())) {
|
||||
return true;
|
||||
}
|
||||
for (JavaMethod method : javaClass.getMethods()) {
|
||||
|
||||
@@ -19,5 +19,5 @@ package kotlin.jvm.internal
|
||||
import java.io.Serializable
|
||||
|
||||
public abstract class ExtensionFunctionImpl<in T, out R> : Serializable {
|
||||
override fun toString() = "${getClass().getGenericInterfaces()[0]}"
|
||||
override fun toString() = "${(this as Object).getClass().getGenericInterfaces()[0]}"
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ package kotlin.jvm.internal
|
||||
import java.io.Serializable
|
||||
|
||||
public abstract class FunctionImpl<out R> : Serializable {
|
||||
override fun toString() = "${getClass().getGenericInterfaces()[0]}"
|
||||
override fun toString() = "${(this as Object).getClass().getGenericInterfaces()[0]}"
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ package kotlin.reflect.jvm.internal
|
||||
import java.io.Serializable
|
||||
|
||||
public abstract class KMemberFunctionImpl<in T, out R> : Serializable {
|
||||
override fun toString() = "${getClass().getGenericInterfaces()[0]}"
|
||||
override fun toString() = "${(this as Object).getClass().getGenericInterfaces()[0]}"
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
-CheckMemberLocationForJava.kt
|
||||
-Some
|
||||
clone(): Any location=→Object
|
||||
equals(Any?): Boolean location=→Object
|
||||
finalize(): Unit location=→Object
|
||||
equals(Any?): Boolean location=→Any
|
||||
foo123(): Unit location=→A3
|
||||
foo12_(): Unit location=→A2
|
||||
foo1_3(): Unit location=→A3
|
||||
@@ -11,11 +9,5 @@
|
||||
foo_2_(): Unit location=→A2
|
||||
foo__3(): Unit location=→A3
|
||||
foo___(): Unit location=→First
|
||||
getClass(): Class<out Any?> location=→Object
|
||||
hashCode(): Int location=→Object
|
||||
notify(): Unit location=→Object
|
||||
notifyAll(): Unit location=→Object
|
||||
toString(): String location=→Object
|
||||
wait(): Unit location=→Object
|
||||
wait(Long): Unit location=→Object
|
||||
wait(Long, Int): Unit location=→Object
|
||||
hashCode(): Int location=→Any
|
||||
toString(): String location=→Any
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
-InheritedJavaMembers.kt
|
||||
-InheritedJavaMembers
|
||||
call(): String? location=→Callable
|
||||
clone(): Any location=→Object
|
||||
equals(Any?): Boolean location=→Object
|
||||
finalize(): Unit location=→Object
|
||||
getClass(): Class<out Any?> location=→Object
|
||||
hashCode(): Int location=→Object
|
||||
notify(): Unit location=→Object
|
||||
notifyAll(): Unit location=→Object
|
||||
equals(Any?): Boolean location=→Any
|
||||
hashCode(): Int location=→Any
|
||||
test(): Unit
|
||||
toString(): String location=→Object
|
||||
wait(): Unit location=→Object
|
||||
wait(Long): Unit location=→Object
|
||||
wait(Long, Int): Unit location=→Object
|
||||
toString(): String location=→Any
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
-InheritedSAMConversion.kt
|
||||
-KotlinTest
|
||||
clone(): Any location=→Object
|
||||
equals(Any?): Boolean location=→Object
|
||||
finalize(): Unit location=→Object
|
||||
equals(Any?): Boolean location=→Any
|
||||
foo((() -> Unit)?): Unit
|
||||
getClass(): Class<out Any?> location=→Object
|
||||
hashCode(): Int location=→Object
|
||||
notify(): Unit location=→Object
|
||||
notifyAll(): Unit location=→Object
|
||||
toString(): String location=→Object
|
||||
wait(): Unit location=→Object
|
||||
wait(Long): Unit location=→Object
|
||||
wait(Long, Int): Unit location=→Object
|
||||
hashCode(): Int location=→Any
|
||||
toString(): String location=→Any
|
||||
|
||||
@@ -26,7 +26,7 @@ class PairTest {
|
||||
assertTrue(p == Pair(1, "a"))
|
||||
assertTrue(p != Pair(2, "a"))
|
||||
assertTrue(p != Pair(1, "b"))
|
||||
assertTrue(!(p : Object).equals(null))
|
||||
assertTrue(!p.equals(null))
|
||||
assertTrue((p : Any) != "")
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class TripleTest {
|
||||
assertTrue(t != Triple(2, "a", 0.0))
|
||||
assertTrue(t != Triple(1, "b", 0.0))
|
||||
assertTrue(t != Triple(1, "a", 0.1))
|
||||
assertTrue(!(t : Object).equals(null))
|
||||
assertTrue(!t.equals(null))
|
||||
assertTrue((t : Any) != "")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user