Treat expect classes as not having implicit default constructors
#KT-15522 Fixed
This commit is contained in:
+3
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -338,11 +338,8 @@ open class LazyClassMemberScope(
|
||||
|
||||
val hasPrimaryConstructor = classOrObject.hasExplicitPrimaryConstructor()
|
||||
if (!hasPrimaryConstructor) {
|
||||
when (thisDescriptor.kind) {
|
||||
ClassKind.INTERFACE -> return null
|
||||
ClassKind.OBJECT, ClassKind.ENUM_CLASS -> if (thisDescriptor.isExpect) return null
|
||||
else -> {}
|
||||
}
|
||||
if (thisDescriptor.isExpect && !DescriptorUtils.isEnumEntry(thisDescriptor)) return null
|
||||
if (DescriptorUtils.isInterface(thisDescriptor)) return null
|
||||
}
|
||||
|
||||
if (DescriptorUtils.canHaveDeclaredConstructors(thisDescriptor) || hasPrimaryConstructor) {
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,6 +30,7 @@ enum class WrongResolutionToClassifier(val message: (Name) -> String) {
|
||||
TYPE_PARAMETER_AS_FUNCTION({ "Type parameter $it cannot be called as function" }),
|
||||
INTERFACE_AS_VALUE({ "Interface $it does not have companion object" }),
|
||||
INTERFACE_AS_FUNCTION({ "Interface $it does not have constructors" }),
|
||||
EXPECT_CLASS_AS_FUNCTION({ "Expected class $it does not have default constructor" }),
|
||||
CLASS_AS_VALUE({ "Class $it does not have companion object" }),
|
||||
INNER_CLASS_CONSTRUCTOR_NO_RECEIVER({ "Constructor of inner class $it can be called only with receiver of containing class" }),
|
||||
OBJECT_AS_FUNCTION({ "Function 'invoke()' is not found in object $it" })
|
||||
@@ -105,6 +106,7 @@ private fun ErrorCandidateContext.getWrongResolutionToClassifier(classifier: Cla
|
||||
|
||||
ClassKind.CLASS -> when {
|
||||
asFunction && explicitReceiver is QualifierReceiver? && classifier.isInner -> INNER_CLASS_CONSTRUCTOR_NO_RECEIVER
|
||||
asFunction && classifier.isExpect -> EXPECT_CLASS_AS_FUNCTION
|
||||
!asFunction -> CLASS_AS_VALUE
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ public final expect enum class E : kotlin.Enum<E> {
|
||||
}
|
||||
|
||||
public final expect class My {
|
||||
public constructor My()
|
||||
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
|
||||
|
||||
+11
-2
@@ -6,6 +6,13 @@ expect annotation class Foo1
|
||||
expect annotation class Foo2
|
||||
expect annotation class Foo3
|
||||
expect annotation class Foo4
|
||||
expect annotation class Foo5()
|
||||
|
||||
@<!NO_CONSTRUCTOR!>Foo1<!>
|
||||
fun foo() {}
|
||||
|
||||
@Foo5
|
||||
fun bar() {}
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
|
||||
@@ -26,8 +33,10 @@ public @interface Bar2 {
|
||||
|
||||
actual typealias Foo1 = Bar1
|
||||
|
||||
<!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>actual typealias Foo4 = Bar2<!>
|
||||
actual typealias Foo4 = Bar2
|
||||
|
||||
actual annotation class Foo2(val p: String = "default")
|
||||
|
||||
actual annotation class Foo3(val a: String = "a", val b: String = "b")
|
||||
actual annotation class Foo3(val a: String = "a", val b: String = "b")
|
||||
|
||||
actual annotation class Foo5
|
||||
+20
-4
@@ -1,29 +1,35 @@
|
||||
// -- Module: <m1-common> --
|
||||
package
|
||||
|
||||
@Foo5 public fun bar(): kotlin.Unit
|
||||
@Foo1 public fun foo(): kotlin.Unit
|
||||
|
||||
public final expect annotation class Foo1 : kotlin.Annotation {
|
||||
public constructor Foo1()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect annotation class Foo2 : kotlin.Annotation {
|
||||
public constructor Foo2()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect annotation class Foo3 : kotlin.Annotation {
|
||||
public constructor Foo3()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect annotation class Foo4 : kotlin.Annotation {
|
||||
public constructor Foo4()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect annotation class Foo5 : kotlin.Annotation {
|
||||
public constructor Foo5()
|
||||
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
|
||||
@@ -33,6 +39,9 @@ public final expect annotation class Foo4 : kotlin.Annotation {
|
||||
// -- Module: <m2-jvm> --
|
||||
package
|
||||
|
||||
@Foo5 public fun bar(): kotlin.Unit
|
||||
@Foo1 /* = Bar1 */ public fun foo(): kotlin.Unit
|
||||
|
||||
public final annotation class Bar1 : kotlin.Annotation {
|
||||
public constructor Bar1(/*0*/ value: kotlin.String = ...)
|
||||
public final val value: kotlin.String
|
||||
@@ -66,5 +75,12 @@ public final actual annotation class Foo3 : kotlin.Annotation {
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final actual annotation class Foo5 : kotlin.Annotation {
|
||||
public constructor Foo5()
|
||||
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
|
||||
}
|
||||
public typealias Foo1 = Bar1
|
||||
public typealias Foo4 = Bar2
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -10,7 +10,6 @@ public final expect annotation class Anno : kotlin.Annotation {
|
||||
}
|
||||
|
||||
public final expect class Class {
|
||||
public constructor Class()
|
||||
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
|
||||
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class Foo
|
||||
expect class Bar()
|
||||
expect class Baz constructor()
|
||||
expect class FooBar {
|
||||
constructor()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<!RESOLUTION_TO_CLASSIFIER!>Foo<!>()
|
||||
Bar()
|
||||
Baz()
|
||||
FooBar()
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class Foo
|
||||
actual class Bar
|
||||
actual class Baz
|
||||
actual class FooBar
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
// -- Module: <m1-common> --
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public final expect class Bar {
|
||||
public constructor Bar()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect class Baz {
|
||||
public constructor Baz()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect class Foo {
|
||||
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
|
||||
}
|
||||
|
||||
public final expect class FooBar {
|
||||
public constructor FooBar()
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <m2-jvm> --
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public final actual class Bar {
|
||||
public constructor Bar()
|
||||
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
|
||||
}
|
||||
|
||||
public final actual class Baz {
|
||||
public constructor Baz()
|
||||
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
|
||||
}
|
||||
|
||||
public final actual class Foo {
|
||||
public constructor Foo()
|
||||
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
|
||||
}
|
||||
|
||||
public final actual class FooBar {
|
||||
public constructor FooBar()
|
||||
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
|
||||
}
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class H {
|
||||
public constructor H()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
Vendored
-1
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class C1 {
|
||||
public constructor C1()
|
||||
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
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
public expect final val foo: kotlin.String
|
||||
public final expect fun bar(/*0*/ x: kotlin.Int): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package
|
||||
public expect fun getFoo(): Foo
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
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
|
||||
|
||||
-1
@@ -9,7 +9,6 @@ public object Delegate {
|
||||
}
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
public expect final val backingFieldVal: kotlin.String = "no"
|
||||
public expect final var backingFieldVar: kotlin.String
|
||||
public expect final val customAccessorVal: kotlin.String
|
||||
|
||||
-6
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class OuterClass {
|
||||
public constructor OuterClass()
|
||||
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
|
||||
@@ -14,7 +13,6 @@ public final expect class OuterClass {
|
||||
}
|
||||
|
||||
public final expect inner class InnerClass {
|
||||
public constructor InnerClass()
|
||||
public expect final val p: kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun f(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
@@ -23,19 +21,16 @@ public final expect class OuterClass {
|
||||
}
|
||||
|
||||
public final expect class NestedClass {
|
||||
public constructor NestedClass()
|
||||
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
|
||||
|
||||
public final expect class DeepNested {
|
||||
public constructor DeepNested()
|
||||
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
|
||||
|
||||
public final expect class Another {
|
||||
public constructor Another()
|
||||
public expect final val p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun f(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
@@ -47,7 +42,6 @@ public final expect class OuterClass {
|
||||
}
|
||||
|
||||
public final expect class OuterClassWithNamedCompanion {
|
||||
public constructor OuterClassWithNamedCompanion()
|
||||
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
|
||||
|
||||
-9
@@ -2,13 +2,11 @@
|
||||
package
|
||||
|
||||
public final expect class B {
|
||||
public constructor B()
|
||||
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
|
||||
|
||||
public final expect class N {
|
||||
public constructor N()
|
||||
public final expect fun body(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun extraHeader(): kotlin.Unit
|
||||
@@ -18,7 +16,6 @@ public final expect class B {
|
||||
}
|
||||
|
||||
public final expect class C {
|
||||
public constructor C()
|
||||
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
|
||||
@@ -38,14 +35,12 @@ public final expect class C {
|
||||
}
|
||||
|
||||
public final expect inner class I {
|
||||
public constructor I()
|
||||
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
|
||||
}
|
||||
|
||||
public final expect class N {
|
||||
public constructor N()
|
||||
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
|
||||
@@ -53,13 +48,11 @@ public final expect class C {
|
||||
}
|
||||
|
||||
public final expect class D {
|
||||
public constructor D()
|
||||
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
|
||||
|
||||
public final expect class N {
|
||||
public constructor N()
|
||||
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
|
||||
@@ -67,13 +60,11 @@ public final expect class D {
|
||||
}
|
||||
|
||||
public final expect class E {
|
||||
public constructor E()
|
||||
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
|
||||
|
||||
public final expect class N {
|
||||
public constructor N()
|
||||
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
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
public final expect fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
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
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ interface J
|
||||
|
||||
expect class Foo : I, C, J
|
||||
|
||||
expect class Bar : C<!SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, JS:SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, JVM:SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS!>()<!>
|
||||
expect class Bar : <!SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR, JS:SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR, JVM:SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR!>C<!SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, JS:SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, JVM:SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS!>()<!><!>
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class Bar : C {
|
||||
public constructor Bar()
|
||||
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
|
||||
@@ -16,7 +15,6 @@ public open class C {
|
||||
}
|
||||
|
||||
public final expect class Foo : I, C, J {
|
||||
public constructor Foo()
|
||||
public open override /*3*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*3*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*3*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public open expect class Foo {
|
||||
public constructor Foo()
|
||||
public open expect fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
public final expect fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package
|
||||
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun foo(/*0*/ i: kotlin.Int, /*1*/ d: kotlin.Double, /*2*/ f: kotlin.Float): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -12,7 +12,6 @@ public final class Outer {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final expect class Nested {
|
||||
public constructor Nested()
|
||||
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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
actual class Foo(x: Int) {
|
||||
actual constructor() : this(0)
|
||||
constructor() : this(0)
|
||||
|
||||
val x: Int = x
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:1:25: error: actual constructor of 'Foo' has no corresponding expected declaration
|
||||
actual class Foo actual constructor() {
|
||||
^
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:2:12: error: actual constructor of 'Foo' has no corresponding expected declaration
|
||||
The following declaration is incompatible because number of value parameters is different:
|
||||
public constructor Foo()
|
||||
|
||||
actual constructor(s: String) : this()
|
||||
^
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:4:5: error: actual function 'nonPlatformFun' has no corresponding expected declaration
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
expect class Printer {
|
||||
expect class Printer() {
|
||||
fun print(message: String)
|
||||
}
|
||||
|
||||
|
||||
@@ -13974,6 +13974,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectClassWithoutConstructor.kt")
|
||||
public void testExpectClassWithoutConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectClassWithoutConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("explicitConstructorDelegation.kt")
|
||||
public void testExplicitConstructorDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.kt");
|
||||
|
||||
+6
@@ -13974,6 +13974,12 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectClassWithoutConstructor.kt")
|
||||
public void testExpectClassWithoutConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectClassWithoutConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("explicitConstructorDelegation.kt")
|
||||
public void testExplicitConstructorDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.kt");
|
||||
|
||||
Reference in New Issue
Block a user