Increase visibility: make not available in case of potential exposed visibility problems (see KT-11920)

This commit is contained in:
Mikhail Glukhikh
2016-04-15 13:23:42 +03:00
parent 6acd4bc21d
commit e806341cdc
5 changed files with 58 additions and 9 deletions
@@ -0,0 +1,14 @@
// "Make bar internal" "false"
// ACTION: Convert property initializer to getter
// ERROR: Cannot access 'bar': it is 'private' in 'First'
private data class Data(val x: Int)
class First {
// Making it internal exposes 'Data'
private fun bar(x: Int) = Data(x)
}
class Second(f: First) {
private val y = f.<caret>bar(42)
}