diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.fir.txt index 677f44e8f23..8c982970fd0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.fir.txt @@ -61,8 +61,8 @@ FILE: multipleBounds.kt } public final fun test(): R|kotlin/Unit| { - #() - #() + #() + #() R|Jet87/Test1.Test1|() } public final class Foo : R|kotlin/Any| { diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt index e0f11693af5..e2452cf929d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt @@ -13,7 +13,7 @@ FILE: typeArgumentsNotAllowed.kt } public final fun foo(): R|kotlin/Unit| { - #<>() + #<>() R|rest/bar|>|>() } public final fun bar(): R|kotlin/Unit| { @@ -44,7 +44,7 @@ FILE: typeArgumentsNotAllowed.kt } public final fun fest(): R|kotlin/Unit| { lval b: R|kotlin/collections/List| - #<>() + #<>() R|rest/gest|() lval c: R|kotlin/collections/List>>| R|rest/gest|>|>() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt index fbca37f9aaa..92e0319b43f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt @@ -19,15 +19,15 @@ FILE: upperBoundViolated.kt public final fun fest(): R|kotlin/Unit| { } public final fun test(): R|kotlin/Unit| { - lval b1: R|B| = #() + lval b1: R|B| = #() lval b2: R|B| = R|/B.B|() - lval b3: R|B| = #() - lval b4: = #<>().#(ERROR_EXPR(No right operand)).#(#()).#(ERROR_EXPR(No right operand)) - lval b5: R|B>| = #|>() - #() + lval b3: R|B| = #() + lval b4: = #<>().#(ERROR_EXPR(No right operand)).#(#()).#(ERROR_EXPR(No right operand)) + lval b5: R|B>| = #|>() + #() R|/fest|() R|/fest|() - #|>() + #|>() } public open class S : R|kotlin/Any| { public constructor(): R|S| { @@ -58,11 +58,11 @@ FILE: upperBoundViolated.kt lval o2: R|S| = R|/S.S|() lval o3: R|S| = R|/S.S|() lval o4: R|S, T>| = R|/S.S||, R|T|>() - lval o5: R|S, T>| = #|, R|T|>() - lval o5: R|S, T>| = #|, R|T|>() + lval o5: R|S, T>| = #|, R|T|>() + lval o5: R|S, T>| = #|, R|T|>() lval o6: R|S, kotlin/String>>| = R|/S.S|, kotlin/String>|>() lval o7: R|S, kotlin/Nothing>>| = R|/S.S|, kotlin/Nothing>|>() - lval o8: R|P>| = #|>() + lval o8: R|P>| = #|>() } public final class NumColl|> : R|kotlin/Any| { public constructor|>(): R|NumColl| { diff --git a/compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt b/compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt index fb6ddefcf80..358937b83e9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt +++ b/compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt @@ -32,6 +32,6 @@ import classes.foo.* fun foo() {} fun test() { - nameOf() - nameOf() + nameOf() + nameOf() } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CreateFreshTypeVariableSubstitutorStage.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CreateFreshTypeVariableSubstitutorStage.kt index e3686870d6a..ba2895c014d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CreateFreshTypeVariableSubstitutorStage.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CreateFreshTypeVariableSubstitutorStage.kt @@ -79,6 +79,12 @@ internal object CreateFreshTypeVariableSubstitutorStage : ResolutionStage() { } } } + if (csBuilder.hasContradiction) { + for (error in csBuilder.errors) { + sink.reportDiagnostic(InferenceError(error)) + } + sink.yieldIfNeed() + } } } diff --git a/compiler/testData/diagnostics/tests/Bounds.fir.kt b/compiler/testData/diagnostics/tests/Bounds.fir.kt index 2168390d0d2..50567a8637e 100644 --- a/compiler/testData/diagnostics/tests/Bounds.fir.kt +++ b/compiler/testData/diagnostics/tests/Bounds.fir.kt @@ -34,7 +34,7 @@ fun test() { bar() bar<Double?>() bar<Double>() - 1.buzz() + 1.buzz<Double>() } fun foo() {} diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt index d783d6241f4..607e6ca2fbf 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt @@ -40,7 +40,7 @@ fun test5() { fun R?.sure() : R = this!! fun test6(l: List?) { - l.sure() + l.sure<T>() } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt index 6c29bad734c..729f13c8f70 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt @@ -13,6 +13,6 @@ fun bar(x: F) { foo1<F>(x) x.foo2() - x.foo2() + x.foo2<F>() } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt index be25a838424..889e27890fc 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt @@ -9,4 +9,4 @@ fun List.map1(f: (T)-> Q): List? = tail!!.map1(f) fun List.map2(f: (T)-> Q): List? = tail.sure().map2(f) -fun List.map3(f: (T)-> Q): List? = tail.sure().map3(f) +fun List.map3(f: (T)-> Q): List? = tail.sure<T>().map3(f) diff --git a/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt b/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt index a2cc3fd99df..d855502227c 100644 --- a/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt @@ -33,7 +33,7 @@ fun foo() { import test.E as U fun bar() { - U.Entry checkType { _<E>() } + U.Entry checkType { _<E>() } U.Entry checkType { _() } U.Companion.Entry checkType { _() } U.NotEntry checkType { _() }