[FIR] fix resolve contract violation from scopes

We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
This commit is contained in:
Ilya Kirillov
2022-12-28 09:59:12 +01:00
committed by teamcity
parent 0d1e7e83b5
commit 1bbcae5ed2
311 changed files with 108 additions and 347 deletions
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FILE: Dict.java
public abstract class Dict<K, V> {
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FILE: Dict.java
public abstract class Dict<K, V> {
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FILE: X.java
import org.jetbrains.annotations.NotNull;
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FILE: X.java
import org.jetbrains.annotations.NotNull;
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// JAVAC_EXPECTED_FILE
// FILE: A.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// FILE: kt1.kt
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// FILE: MyFuture.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// FULL_JDK
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !SKIP_JAVAC
// SKIP_TXT
// !LANGUAGE: -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !SKIP_JAVAC
// SKIP_TXT
// !LANGUAGE: -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
@@ -1,13 +1,13 @@
/main.kt:24:5: warning: type parameter 'X' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
/main.kt:23:5: warning: type parameter 'X' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
override fun takeV(x: X)
^
/main.kt:25:5: warning: type parameter 'E1' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
/main.kt:24:5: warning: type parameter 'E1' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
override fun <E1> takeE(e: E1)
^
/main.kt:27:5: warning: type parameter 'X' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
/main.kt:26:5: warning: type parameter 'X' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
override fun takeVList(l: List<X>)
^
/main.kt:28:5: warning: type parameter 'E2' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
/main.kt:27:5: warning: type parameter 'E2' has nullable upper bound, so override has incorrect signature comparing with a base member with NotNull annotation. Please add a non-nullable upper bound (e.g. Any) to the type parameter. See https://kotlinlang.org/docs/generics.html#upper-bounds and https://youtrack.jetbrains.com/issue/KT-36770 for more details. This warning will become an error soon.
override fun <E2> takeEList(l2: List<E2>)
^
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !SKIP_JAVAC
// !LANGUAGE: -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
// !LANGUAGE: +DefinitelyNonNullableTypes
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !SKIP_JAVAC
// !LANGUAGE: -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
// !LANGUAGE: +DefinitelyNonNullableTypes
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !SKIP_JAVAC
// !LANGUAGE: -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
// FILE: SLRUMap.java
@@ -1,4 +1,3 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// !SKIP_JAVAC
// !LANGUAGE: -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
// FILE: SLRUMap.java