[FIR] Add NO_THIS & INSTANCE_ACCESS_BEFORE_SUPER_CALL

This commit is contained in:
Nick
2020-08-17 17:21:46 +03:00
parent 7e1c2cfd36
commit c8f8908a01
86 changed files with 526 additions and 219 deletions
@@ -10,13 +10,13 @@ class Foo {
inner class Bar {
fun good() {
contract {
returns() implies (this@Bar != null)
returns() implies (<!UNRESOLVED_LABEL!>this@Bar<!> != null)
}
}
fun badOuter() {
contract {
returns() implies (this@Foo != null)
returns() implies (<!UNRESOLVED_LABEL!>this@Foo<!> != null)
}
}
@@ -34,7 +34,7 @@ class Foo {
fun A?.badWithReceiver() {
contract {
returns() implies (this@Bar != null)
returns() implies (<!UNRESOLVED_LABEL!>this@Bar<!> != null)
}
}
}
@@ -3,7 +3,7 @@
interface Inv
class Impl : Inv
class Scope<InterfaceT, ImplementationT : InterfaceT>(private val implClass: <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>j.Class<ImplementationT><!>) {
class Scope<InterfaceT, ImplementationT : InterfaceT>(private val implClass: <!UNRESOLVED_REFERENCE!>j.Class<ImplementationT><!>) {
fun foo(c: Collection<InterfaceT>) {
val hm = c.asSequence()
.<!INAPPLICABLE_CANDIDATE!>filter<!>(<!UNRESOLVED_REFERENCE!>implClass::isInstance<!>)
@@ -1,5 +1,5 @@
data class A(val x: <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>Set<CLassNotFound><!> = setOf()) {
fun with(x: <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>Set<CLassNotFound>?<!> = null) {
data class A(val x: <!UNRESOLVED_REFERENCE!>Set<CLassNotFound><!> = setOf()) {
fun with(x: <!UNRESOLVED_REFERENCE!>Set<CLassNotFound>?<!> = null) {
A(x ?: this.x)
}
}