forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process non-aload0 outer access in constructor during inline
#KT-17972 Fixed
- Loading branch information
Mikhael Bogdanov
committed
May 26, 2017
1 parent
5e265b3
commit 3f7bf84
Showing
13 changed files
with
392 additions
and
5 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
33 changes: 33 additions & 0 deletions
33
compiler/testData/codegen/boxInline/anonymousObject/kt17972.kt
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,33 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
object { | ||
val inflater = prop | ||
}.inflater | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
33 changes: 33 additions & 0 deletions
33
compiler/testData/codegen/boxInline/anonymousObject/kt17972_2.kt
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,33 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
inlineFun2 { | ||
object { | ||
val inflater = prop | ||
}.inflater | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
inline fun <T> inlineFun2(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
35 changes: 35 additions & 0 deletions
35
compiler/testData/codegen/boxInline/anonymousObject/kt17972_3.kt
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,35 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
inlineFun { | ||
object { | ||
val inflater = prop | ||
}.inflater | ||
} | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
37 changes: 37 additions & 0 deletions
37
compiler/testData/codegen/boxInline/anonymousObject/kt17972_4.kt
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,37 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
inlineFun { | ||
noInline { | ||
object { | ||
val inflater = prop | ||
}.inflater | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
35 changes: 35 additions & 0 deletions
35
compiler/testData/codegen/boxInline/anonymousObject/kt17972_5.kt
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,35 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
noInline { | ||
object { | ||
val inflater = prop | ||
}.inflater | ||
} | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
35 changes: 35 additions & 0 deletions
35
compiler/testData/codegen/boxInline/anonymousObject/kt17972_super.kt
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,35 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
open class A(val value: String) | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
object : A(prop) { | ||
|
||
}.value | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
37 changes: 37 additions & 0 deletions
37
compiler/testData/codegen/boxInline/anonymousObject/kt17972_super2.kt
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,37 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
open class A(val value: String) | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
inlineFun { | ||
object : A(prop) { | ||
|
||
}.value | ||
} | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
39 changes: 39 additions & 0 deletions
39
compiler/testData/codegen/boxInline/anonymousObject/kt17972_super3.kt
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,39 @@ | ||
// FILE: 1.kt | ||
package test | ||
|
||
open class A(val value: String) | ||
|
||
class Test { | ||
|
||
val prop: String = "OK" | ||
|
||
fun test() = | ||
inlineFun { | ||
noInline { | ||
inlineFun { | ||
noInline { | ||
object : A(prop) { | ||
|
||
}.value | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
inline fun <T> inlineFun(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
fun <T> noInline(init: () -> T): T { | ||
return init() | ||
} | ||
|
||
// FILE: 2.kt | ||
//NO_CHECK_LAMBDA_INLINING | ||
|
||
import test.* | ||
|
||
fun box(): String { | ||
return Test().test() | ||
} |
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
Oops, something went wrong.