Prohibit instance access before super call
- Before this change members just left unresolved as they were absent in the specific scope named scopeForSecondaryConstructorHeaderResolution that created just to prohibit such accesses. - Now they are resolved the same way as other members, but diagnostic is repored by in-place injected CallChecker - Drop obsolete type of class scope #KT-6995 Fixed
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
open class B(x: Int) {
|
||||
fun foo() = 1
|
||||
}
|
||||
class A : B {
|
||||
constructor(x: Int, y: Int = x + <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>foo<!>() + <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.foo() + <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>super<!>.foo()) :
|
||||
super(x + <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>foo<!>() + <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.foo() + <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>super<!>.foo())
|
||||
}
|
||||
Reference in New Issue
Block a user