Deprecate protected constructors call from public inline function

#KT-21177
This commit is contained in:
Mikhael Bogdanov
2020-10-27 09:55:32 +01:00
parent a72cdeabb4
commit 21521aa397
10 changed files with 91 additions and 6 deletions
+18
View File
@@ -0,0 +1,18 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class SomeContainer {
protected class Limit
protected fun makeLimit(): Limit = TODO()
public inline fun foo(f: () -> Unit) {
<!PROTECTED_CONSTRUCTOR_CALL_FROM_PUBLIC_INLINE!>Limit<!>()
<!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>makeLimit<!>()
}
}
open class A protected constructor() {
inline fun foo(f: () -> Unit) {
<!PROTECTED_CONSTRUCTOR_CALL_FROM_PUBLIC_INLINE!>A<!>()
}
}