forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,363 additions
and
1,250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from output import multi11, multi12, multi21, multi22, multi31, multi32, multi33, child | ||
import output | ||
|
||
multi11() | ||
print(output.s) | ||
multi12() | ||
print(output.s) | ||
|
||
multi21() | ||
print(output.s) | ||
multi22() | ||
print(output.s) | ||
|
||
multi31() | ||
print(output.s) | ||
multi32() | ||
print(output.s) | ||
multi33() | ||
print(output.s) | ||
|
||
child() | ||
print(output.s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
var s = "abc" | ||
|
||
class MultiConstructors1(a: Int) { | ||
|
||
init { | ||
s = "body 11" | ||
} | ||
|
||
constructor(b: String) : this(2) { | ||
s = "body 12" | ||
} | ||
} | ||
|
||
fun multi11() { | ||
MultiConstructors1(1) | ||
} | ||
|
||
fun multi12() { | ||
MultiConstructors1("a") | ||
} | ||
|
||
class MultiConstructors2 { | ||
|
||
constructor(a: Int) { | ||
s = "body 21" | ||
} | ||
|
||
constructor(b: String) { | ||
s = "body 22" | ||
} | ||
} | ||
|
||
fun multi21() { | ||
MultiConstructors2(1) | ||
} | ||
|
||
fun multi22() { | ||
MultiConstructors2("a") | ||
} | ||
|
||
class MultiConstructors3 { | ||
|
||
constructor(a: Int) { | ||
s = "body 31" | ||
} | ||
|
||
constructor(b: String) : this(3) { | ||
s = "body 32" | ||
} | ||
|
||
constructor(b: Boolean) : this("c") { | ||
s = "body 33" | ||
} | ||
} | ||
|
||
fun multi31() { | ||
MultiConstructors3(1) | ||
} | ||
|
||
fun multi32() { | ||
MultiConstructors3("a") | ||
} | ||
|
||
fun multi33() { | ||
MultiConstructors3(true) | ||
} | ||
|
||
abstract class BaseClass { | ||
|
||
constructor(i: Int) { | ||
s = "body base" | ||
} | ||
} | ||
|
||
class ChildClass : BaseClass { | ||
|
||
constructor(a: Int) : super(4) { | ||
s = "body child" | ||
} | ||
} | ||
|
||
fun child() { | ||
ChildClass(123) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
body 11 | ||
body 12 | ||
body 21 | ||
body 22 | ||
body 31 | ||
body 32 | ||
body 33 | ||
body child |
Oops, something went wrong.