[FIR] Fix location for CONFLICTING_PROJECTION diagnostics, extend conflictingProjection.kt with test sample
This commit is contained in:
committed by
teamcityserver
parent
ce78457eaa
commit
b85846c0c0
+23
@@ -156,3 +156,26 @@ FILE: conflictingProjection.kt
|
||||
public final fun test18(): R|InOuter.OutIntermediate.InInner<out kotlin/Char, in kotlin/String, kotlin/Int>| {
|
||||
^test18 R|/InOuter.InOuter|<R|kotlin/Int|>().R|SubstitutionOverride</InOuter.OutIntermediate.OutIntermediate>|<R|kotlin/String|>().R|SubstitutionOverride</InOuter.OutIntermediate.InInner.InInner>|<R|kotlin/Any?|>()
|
||||
}
|
||||
public final class TwoParametersOuter<T, in T1> : R|kotlin/Any| {
|
||||
public constructor<T, in T1>(): R|TwoParametersOuter<T, T1>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final inner class TwoParametersIntermediate<out K, K1, T, in T1> : R|kotlin/Any| {
|
||||
public constructor<out K, K1>(): R|TwoParametersOuter.TwoParametersIntermediate<K, K1, T, T1>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final inner class InInner<in G, G1, out K, K1, T, in T1> : R|kotlin/Any| {
|
||||
public constructor<in G, G1>(): R|TwoParametersOuter.TwoParametersIntermediate.InInner<G, G1, K, K1, T, T1>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test19(): R|TwoParametersOuter.TwoParametersIntermediate.InInner<kotlin/Char, kotlin/Char, in kotlin/String, kotlin/Int, kotlin/Int, out kotlin/String>?| {
|
||||
^test19 Null(null)
|
||||
}
|
||||
|
||||
+21
-12
@@ -8,10 +8,10 @@ fun a3(value: None<out Int>) {}
|
||||
|
||||
fun a4(value: In<Int>) {}
|
||||
fun a5(value: In<in Int>) {}
|
||||
fun a6(value: <!CONFLICTING_PROJECTION!>In<out Int><!>) {}
|
||||
fun a6(value: In<<!CONFLICTING_PROJECTION!>out<!> Int>) {}
|
||||
|
||||
fun a7(value: Out<Int>) {}
|
||||
fun a8(value: <!CONFLICTING_PROJECTION!>Out<in Int><!>) {}
|
||||
fun a8(value: Out<<!CONFLICTING_PROJECTION!>in<!> Int>) {}
|
||||
fun a9(value: Out<out Int>) {}
|
||||
|
||||
typealias A1<K> = None<K>
|
||||
@@ -28,26 +28,26 @@ typealias A9<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = None<out K>
|
||||
|
||||
typealias A10<K> = In<K>
|
||||
typealias A11<K> = In<in K>
|
||||
typealias A12<K> = <!CONFLICTING_PROJECTION!>In<out K><!>
|
||||
typealias A12<K> = In<<!CONFLICTING_PROJECTION!>out<!> K>
|
||||
|
||||
typealias A13<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = In<K>
|
||||
typealias A14<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = In<in K>
|
||||
typealias A15<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = <!CONFLICTING_PROJECTION!>In<out K><!>
|
||||
typealias A15<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = In<<!CONFLICTING_PROJECTION!>out<!> K>
|
||||
|
||||
typealias A16<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = In<K>
|
||||
typealias A17<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = In<in K>
|
||||
typealias A18<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = <!CONFLICTING_PROJECTION!>In<out K><!>
|
||||
typealias A18<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = In<<!CONFLICTING_PROJECTION!>out<!> K>
|
||||
|
||||
typealias A19<K> = Out<K>
|
||||
typealias A20<K> = <!CONFLICTING_PROJECTION!>Out<in K><!>
|
||||
typealias A20<K> = Out<<!CONFLICTING_PROJECTION!>in<!> K>
|
||||
typealias A21<K> = Out<out K>
|
||||
|
||||
typealias A22<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = Out<K>
|
||||
typealias A23<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = <!CONFLICTING_PROJECTION!>Out<in K><!>
|
||||
typealias A23<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = Out<<!CONFLICTING_PROJECTION!>in<!> K>
|
||||
typealias A24<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>in<!> K> = Out<out K>
|
||||
|
||||
typealias A25<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = Out<K>
|
||||
typealias A26<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = <!CONFLICTING_PROJECTION!>Out<in K><!>
|
||||
typealias A26<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = Out<<!CONFLICTING_PROJECTION!>in<!> K>
|
||||
typealias A27<<!VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED!>out<!> K> = Out<out K>
|
||||
|
||||
class Outer<T> {
|
||||
@@ -83,13 +83,22 @@ class InOuter<in T> {
|
||||
fun test10(): InOuter<Int>.OutIntermediate<String>.InInner<Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
|
||||
fun test11(): InOuter<in Int>.OutIntermediate<String>.InInner<Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test12(): <!CONFLICTING_PROJECTION!>InOuter<out Int>.OutIntermediate<String>.InInner<Char><!> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test12(): InOuter<<!CONFLICTING_PROJECTION!>out<!> Int>.OutIntermediate<String>.InInner<Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
|
||||
fun test13(): <!CONFLICTING_PROJECTION!>InOuter<Int>.OutIntermediate<in String>.InInner<Char><!> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test13(): InOuter<Int>.OutIntermediate<<!CONFLICTING_PROJECTION!>in<!> String>.InInner<Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test14(): InOuter<Int>.OutIntermediate<out String>.InInner<Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
|
||||
fun test15(): InOuter<Int>.OutIntermediate<String>.InInner<in Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test16(): <!CONFLICTING_PROJECTION!>InOuter<Int>.OutIntermediate<String>.InInner<out Char><!> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test16(): InOuter<Int>.OutIntermediate<String>.InInner<<!CONFLICTING_PROJECTION!>out<!> Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
|
||||
fun test17(): InOuter<in Int>.OutIntermediate<out String>.InInner<Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test18(): <!CONFLICTING_PROJECTION!>InOuter<Int>.OutIntermediate<in String>.InInner<out Char><!> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
fun test18(): InOuter<Int>.OutIntermediate<<!CONFLICTING_PROJECTION!>in<!> String>.InInner<<!CONFLICTING_PROJECTION!>out<!> Char> = InOuter<Int>().OutIntermediate<String>().InInner()
|
||||
|
||||
class TwoParametersOuter<T, in T1> {
|
||||
inner class TwoParametersIntermediate<out K, K1> {
|
||||
inner class InInner<in G, G1> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun test19(): TwoParametersOuter<Int, <!CONFLICTING_PROJECTION!>out<!> String>.TwoParametersIntermediate<<!CONFLICTING_PROJECTION!>in<!> String, Int>.InInner<Char, Char>? = null
|
||||
|
||||
+1
-1
@@ -380,7 +380,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
||||
val TYPE_PARAMETERS_IN_OBJECT by error<PsiElement>()
|
||||
val ILLEGAL_PROJECTION_USAGE by error<PsiElement>()
|
||||
val TYPE_PARAMETERS_IN_ENUM by error<PsiElement>()
|
||||
val CONFLICTING_PROJECTION by error<PsiElement> {
|
||||
val CONFLICTING_PROJECTION by error<KtTypeParameter>(PositioningStrategy.VARIANCE_MODIFIER) {
|
||||
parameter<ConeKotlinType>("type")
|
||||
}
|
||||
val VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED by error<KtTypeParameter>(PositioningStrategy.VARIANCE_MODIFIER)
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ object FirErrors {
|
||||
val TYPE_PARAMETERS_IN_OBJECT by error0<PsiElement>()
|
||||
val ILLEGAL_PROJECTION_USAGE by error0<PsiElement>()
|
||||
val TYPE_PARAMETERS_IN_ENUM by error0<PsiElement>()
|
||||
val CONFLICTING_PROJECTION by error1<PsiElement, ConeKotlinType>()
|
||||
val CONFLICTING_PROJECTION by error1<KtTypeParameter, ConeKotlinType>(SourceElementPositioningStrategies.VARIANCE_MODIFIER)
|
||||
val VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED by error0<KtTypeParameter>(SourceElementPositioningStrategies.VARIANCE_MODIFIER)
|
||||
val CATCH_PARAMETER_WITH_DEFAULT_VALUE by error0<PsiElement>()
|
||||
val REIFIED_TYPE_IN_CATCH_CLAUSE by error0<PsiElement>()
|
||||
|
||||
+2
-2
@@ -154,7 +154,7 @@ object FirClassVarianceChecker : FirClassChecker() {
|
||||
}
|
||||
|
||||
if (newVariance != null) {
|
||||
val subTypeRef = extractChildFirTypeRef(typeRef, index)
|
||||
val subTypeRef = extractTypeArgumentTypeRef(typeRef, index)
|
||||
|
||||
checkVarianceConflict(
|
||||
typeArgumentType, newVariance, subTypeRef, containingType,
|
||||
@@ -167,7 +167,7 @@ object FirClassVarianceChecker : FirClassChecker() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractChildFirTypeRef(typeRef: FirTypeRef?, index: Int): FirTypeRef? {
|
||||
private fun extractTypeArgumentTypeRef(typeRef: FirTypeRef?, index: Int): FirTypeRef? {
|
||||
if (typeRef is FirResolvedTypeRef) {
|
||||
val delegatedTypeRef = typeRef.delegatedTypeRef
|
||||
if (delegatedTypeRef is FirUserTypeRef) {
|
||||
|
||||
+31
-2
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.declaration
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
|
||||
@@ -66,9 +67,37 @@ object FirConflictingProjectionChecker : FirBasicDeclarationChecker() {
|
||||
actual is ConeKotlinTypeProjectionIn && protoVariance == Variance.OUT_VARIANCE ||
|
||||
actual is ConeKotlinTypeProjectionOut && protoVariance == Variance.IN_VARIANCE
|
||||
) {
|
||||
reporter.reportOn(typeRef.source, FirErrors.CONFLICTING_PROJECTION, typeRef.coneType, context)
|
||||
return
|
||||
val typeArgSource = extractTypeArgumentSource(typeRef, it)
|
||||
reporter.reportOn(typeArgSource ?: typeRef.source, FirErrors.CONFLICTING_PROJECTION, typeRef.coneType, context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractTypeArgumentSource(typeRef: FirTypeRef, index: Int): FirSourceElement? {
|
||||
if (typeRef is FirResolvedTypeRef) {
|
||||
val delegatedTypeRef = typeRef.delegatedTypeRef
|
||||
if (delegatedTypeRef is FirUserTypeRef) {
|
||||
var currentTypeArguments: List<FirTypeProjection>? = null
|
||||
var currentIndex = index
|
||||
val qualifier = delegatedTypeRef.qualifier
|
||||
|
||||
for (i in qualifier.size - 1 downTo 0) {
|
||||
val typeArguments = qualifier[i].typeArgumentList.typeArguments
|
||||
if (currentIndex < typeArguments.size) {
|
||||
currentTypeArguments = typeArguments
|
||||
break
|
||||
} else {
|
||||
currentIndex -= typeArguments.size
|
||||
}
|
||||
}
|
||||
|
||||
val typeArgument = currentTypeArguments?.elementAtOrNull(currentIndex)
|
||||
if (typeArgument is FirTypeProjectionWithVariance) {
|
||||
return typeArgument.source
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
warning: ATTENTION!
|
||||
This build uses in-dev FIR:
|
||||
-Xuse-fir
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:10:15: error: projection is conflicting with variance of the corresponding type parameter of Out<in kotlin/Int>. Remove the projection or replace it with '*'
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:10:19: error: projection is conflicting with variance of the corresponding type parameter of Out<in kotlin/Int>. Remove the projection or replace it with '*'
|
||||
fun a8(value: Out<in Int>) {}
|
||||
^
|
||||
^
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:17:15: error: variance annotations are only allowed for type parameters of classes and interfaces
|
||||
typealias A13<in K> = In<K>
|
||||
^
|
||||
@@ -13,7 +13,7 @@ typealias A14<in K> = In<in K>
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:19:15: error: variance annotations are only allowed for type parameters of classes and interfaces
|
||||
typealias A15<in K> = In<out K>
|
||||
^
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:19:23: error: projection is conflicting with variance of the corresponding type parameter of In<out K>. Remove the projection or replace it with '*'
|
||||
compiler/testData/cli/jvm/conflictingProjection.kt:19:26: error: projection is conflicting with variance of the corresponding type parameter of In<out K>. Remove the projection or replace it with '*'
|
||||
typealias A15<in K> = In<out K>
|
||||
^
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
|
||||
Vendored
+2
-2
@@ -4,11 +4,11 @@ class Inv<T>
|
||||
class X
|
||||
|
||||
fun f1(p: In<in X>) {}
|
||||
fun f2(p: <!CONFLICTING_PROJECTION!>In<out X><!>) {}
|
||||
fun f2(p: In<<!CONFLICTING_PROJECTION!>out<!> X>) {}
|
||||
fun f3(p: In<X>) {}
|
||||
|
||||
fun f4(p: Out<out X>) {}
|
||||
fun f5(p: <!CONFLICTING_PROJECTION!>Out<in X><!>) {}
|
||||
fun f5(p: Out<<!CONFLICTING_PROJECTION!>in<!> X>) {}
|
||||
fun f6(p: Out<X>) {}
|
||||
|
||||
fun f6(p: Inv<X>) {}
|
||||
|
||||
@@ -51,7 +51,7 @@ val String.x1 get() = ""
|
||||
|
||||
fun <K> bar1(f: KFunction2<K, String, String>) {}
|
||||
|
||||
fun <K> bar2(f: <!CONFLICTING_PROJECTION!>KFunction2<out K, String, String><!>) {}
|
||||
fun <K> bar2(f: KFunction2<<!CONFLICTING_PROJECTION!>out<!> K, String, String>) {}
|
||||
|
||||
fun <K> bar3(f: Any?) {}
|
||||
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ class In<in T>() {
|
||||
|
||||
fun test1(x: In<String>): Unit = x.f("1")
|
||||
fun test2(x: In<in String>): Unit = x.f("1")
|
||||
fun test3(x: <!CONFLICTING_PROJECTION!>In<out String><!>): Unit = x.<!UNRESOLVED_REFERENCE!>f<!>("1")
|
||||
fun test4(x: In<*>): Unit = x.<!NONE_APPLICABLE!>f<!>("1")
|
||||
fun test3(x: In<<!CONFLICTING_PROJECTION!>out<!> String>): Unit = x.<!UNRESOLVED_REFERENCE!>f<!>("1")
|
||||
fun test4(x: In<*>): Unit = x.<!NONE_APPLICABLE!>f<!>("1")
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ interface Out<out T>
|
||||
typealias InAlias<T> = In<T>
|
||||
typealias OutAlias<T> = Out<T>
|
||||
|
||||
typealias TestOutForIn<T> = <!CONFLICTING_PROJECTION!>In<out T><!>
|
||||
typealias TestInForOut<T> = <!CONFLICTING_PROJECTION!>Out<in T><!>
|
||||
typealias TestOutForIn<T> = In<<!CONFLICTING_PROJECTION!>out<!> T>
|
||||
typealias TestInForOut<T> = Out<<!CONFLICTING_PROJECTION!>in<!> T>
|
||||
|
||||
typealias TestOutForInWithinAlias<T> = InAlias<out T>
|
||||
typealias TestInForOutWithinAlias<T> = OutAlias<in T>
|
||||
|
||||
@@ -6,11 +6,11 @@ class Inv<T>
|
||||
|
||||
typealias In1<T> = In<T>
|
||||
typealias In2<T> = In<in T>
|
||||
typealias In3<T> = <!CONFLICTING_PROJECTION!>In<out T><!>
|
||||
typealias In3<T> = In<<!CONFLICTING_PROJECTION!>out<!> T>
|
||||
typealias In4<T> = In<*>
|
||||
|
||||
typealias Out1<T> = Out<T>
|
||||
typealias Out2<T> = <!CONFLICTING_PROJECTION!>Out<in T><!>
|
||||
typealias Out2<T> = Out<<!CONFLICTING_PROJECTION!>in<!> T>
|
||||
typealias Out3<T> = Out<out T>
|
||||
typealias Out4<T> = Out<*>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ interface Test<in I, out O, P> {
|
||||
fun neOk6(i: In<In<<!TYPE_VARIANCE_CONFLICT("O; out; in; In<In<O>>")!>O<!>>>)
|
||||
fun neOk7(i: Pair<In<<!TYPE_VARIANCE_CONFLICT("I; in; out; Pair<In<I>, O>")!>I<!>>, <!TYPE_VARIANCE_CONFLICT("O; out; in; Pair<In<I>, O>")!>O<!>>)
|
||||
fun neOk8(i: Inv<out <!TYPE_VARIANCE_CONFLICT("O; out; in; Inv<out O>")!>O<!>>)
|
||||
fun neOk9(i: <!CONFLICTING_PROJECTION!>In<out P><!>)
|
||||
fun neOk9(i: In<<!CONFLICTING_PROJECTION!>out<!> P>)
|
||||
fun neOk10(i: Out<<!TYPE_VARIANCE_CONFLICT("O; out; in; Out<O>")!>O<!>>)
|
||||
|
||||
fun neOk11(i: Inv<in <!TYPE_VARIANCE_CONFLICT("I; in; out; Inv<in I>")!>I<!>>)
|
||||
|
||||
@@ -23,7 +23,7 @@ interface Test<in I, out O, P> {
|
||||
var neOk7: Pair<In<<!TYPE_VARIANCE_CONFLICT("I; in; invariant; Pair<In<I>, O>")!>I<!>>, <!TYPE_VARIANCE_CONFLICT("O; out; invariant; Pair<In<I>, O>")!>O<!>>
|
||||
var neOk8: Inv<in <!TYPE_VARIANCE_CONFLICT("O; out; invariant; Inv<in O>")!>O<!>>
|
||||
var neOk9: Inv<in <!TYPE_VARIANCE_CONFLICT("I; in; invariant; Inv<in I>")!>I<!>>
|
||||
var neOk10: <!CONFLICTING_PROJECTION!>In<out I><!>
|
||||
var neOk10: In<<!CONFLICTING_PROJECTION!>out<!> I>
|
||||
|
||||
var neOk11: <!TYPE_VARIANCE_CONFLICT("I; in; invariant; I")!>I<!>
|
||||
var neOk12: In<<!TYPE_VARIANCE_CONFLICT("O; out; invariant; In<O>")!>O<!>>
|
||||
|
||||
+11
-11
@@ -21,20 +21,20 @@ interface Test<in I, out O, P> {
|
||||
fun ok12(): Inv<in P>
|
||||
fun ok13(): Inv<out P>
|
||||
|
||||
fun neOk1(): <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
fun neOk2(): In<<!TYPE_VARIANCE_CONFLICT!>O<!>>
|
||||
fun neOk3(): In<In<<!TYPE_VARIANCE_CONFLICT!>I<!>>>
|
||||
fun neOk4(): Inv<<!TYPE_VARIANCE_CONFLICT!>I<!>>
|
||||
fun neOk5(): Inv<<!TYPE_VARIANCE_CONFLICT!>O<!>>
|
||||
fun neOk6(): Pair<In<<!TYPE_VARIANCE_CONFLICT!>O<!>>, <!TYPE_VARIANCE_CONFLICT!>I<!>>
|
||||
fun neOk7(): Inv<in <!TYPE_VARIANCE_CONFLICT!>O<!>>
|
||||
fun neOk8(): <!CONFLICTING_PROJECTION!>Out<in I><!>
|
||||
fun neOk1(): <!TYPE_VARIANCE_CONFLICT("I; in; out; I")!>I<!>
|
||||
fun neOk2(): In<<!TYPE_VARIANCE_CONFLICT("O; out; in; In<O>")!>O<!>>
|
||||
fun neOk3(): In<In<<!TYPE_VARIANCE_CONFLICT("I; in; out; In<In<I>>")!>I<!>>>
|
||||
fun neOk4(): Inv<<!TYPE_VARIANCE_CONFLICT("I; in; invariant; Inv<I>")!>I<!>>
|
||||
fun neOk5(): Inv<<!TYPE_VARIANCE_CONFLICT("O; out; invariant; Inv<O>")!>O<!>>
|
||||
fun neOk6(): Pair<In<<!TYPE_VARIANCE_CONFLICT("O; out; in; Pair<In<O>, I>")!>O<!>>, <!TYPE_VARIANCE_CONFLICT("I; in; out; Pair<In<O>, I>")!>I<!>>
|
||||
fun neOk7(): Inv<in <!TYPE_VARIANCE_CONFLICT("O; out; in; Inv<in O>")!>O<!>>
|
||||
fun neOk8(): Out<<!CONFLICTING_PROJECTION("Out<in I>")!>in<!> I>
|
||||
|
||||
fun neOk10(): Inv<in <!TYPE_VARIANCE_CONFLICT!>O<!>>
|
||||
fun neOk11(): Inv<out <!TYPE_VARIANCE_CONFLICT!>I<!>>
|
||||
fun neOk10(): Inv<in <!TYPE_VARIANCE_CONFLICT("O; out; in; Inv<in O>")!>O<!>>
|
||||
fun neOk11(): Inv<out <!TYPE_VARIANCE_CONFLICT("I; in; out; Inv<out I>")!>I<!>>
|
||||
|
||||
fun neOk30(): <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Pair<I, ><!>
|
||||
fun neOk31(): Pair<<!TYPE_VARIANCE_CONFLICT!>I<!>, <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Inv<!>>
|
||||
fun neOk31(): Pair<<!TYPE_VARIANCE_CONFLICT("I; in; out; Pair<I, ERROR CLASS: Wrong number of type arguments>")!>I<!>, <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Inv<!>>
|
||||
fun neOk32(): <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Inv<!>
|
||||
fun neOk33(): Inv<<!SYNTAX!><!>>
|
||||
fun neOk34(): Inv<<!UNRESOLVED_REFERENCE!>C<!>>
|
||||
|
||||
+1
-1
@@ -840,7 +840,7 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = TypeParametersInEnum::class
|
||||
}
|
||||
|
||||
abstract class ConflictingProjection : KtFirDiagnostic<PsiElement>() {
|
||||
abstract class ConflictingProjection : KtFirDiagnostic<KtTypeParameter>() {
|
||||
override val diagnosticClass get() = ConflictingProjection::class
|
||||
abstract val type: KtType
|
||||
}
|
||||
|
||||
+1
-1
@@ -1358,7 +1358,7 @@ internal class ConflictingProjectionImpl(
|
||||
override val type: KtType,
|
||||
firDiagnostic: FirPsiDiagnostic<*>,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.ConflictingProjection(), KtAbstractFirDiagnostic<PsiElement> {
|
||||
) : KtFirDiagnostic.ConflictingProjection(), KtAbstractFirDiagnostic<KtTypeParameter> {
|
||||
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user