Don't generate primary constructor body for expect classes

This commit is contained in:
Dmitry Petrov
2018-02-12 11:11:31 +03:00
parent 839ebba157
commit 36128ba66f
7 changed files with 109 additions and 5 deletions
@@ -0,0 +1,19 @@
// !LANGUAGE: +MultiPlatformProjects
expect abstract class A protected constructor() {
abstract fun foo()
}
expect open class B(i: Int): A {
override fun foo()
open fun bar(s: String)
}
actual abstract class A protected actual constructor() {
actual abstract fun foo()
}
actual open class B actual constructor(i: Int): A() {
actual override fun foo() {}
actual open fun bar(s: String) {}
}
@@ -0,0 +1,65 @@
FILE fqName:<root> fileName:/expectClassInherited.kt
CLASS CLASS name:A modality:ABSTRACT visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:A flags:
CONSTRUCTOR visibility:protected <> () returnType:A flags:
FUN name:foo visibility:public modality:ABSTRACT <> ($this:A) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:A flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS CLASS name:B modality:OPEN visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:B flags:
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:B flags:
VALUE_PARAMETER name:i index:0 type:kotlin.Int flags:
FUN name:foo visibility:public modality:OPEN <> ($this:B) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:B flags:
FUN name:bar visibility:public modality:OPEN <> ($this:B, s:kotlin.String) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:B flags:
VALUE_PARAMETER name:s index:0 type:kotlin.String flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS CLASS name:A modality:ABSTRACT visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:A flags:
CONSTRUCTOR visibility:protected <> () returnType:A flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='A'
FUN name:foo visibility:public modality:ABSTRACT <> ($this:A) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:A flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS CLASS name:B modality:OPEN visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:B flags:
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:B flags:
VALUE_PARAMETER name:i index:0 type:kotlin.Int flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor A()'
INSTANCE_INITIALIZER_CALL classDescriptor='B'
FUN name:foo visibility:public modality:OPEN <> ($this:B) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:B flags:
BLOCK_BODY
FUN name:bar visibility:public modality:OPEN <> ($this:B, s:kotlin.String) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:B flags:
VALUE_PARAMETER name:s index:0 type:kotlin.String flags:
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags: