Refine INSTANCE_ACCESS_BEFORE_SUPER_CALL check
- Detect usages of unitialized `this` as extension receiver argument - Make it work within object literal created before super call #KT-9120 Fixed #KT-8289 Fixed
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun A.foobar() = 3
|
||||
|
||||
class A {
|
||||
fun foo() = 1
|
||||
constructor(x: () -> Int)
|
||||
constructor() : this(
|
||||
{
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>foo<!>() +
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.foo() +
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this@A<!>.foo() +
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>foobar<!>()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user