FIR: Support special scope for raw types
^KT-46369 Fixed ^KT-41794 Fixed ^KT-49351 Fixed
This commit is contained in:
committed by
Space Team
parent
1215ae0fe7
commit
5cc31114cd
+6
@@ -24187,6 +24187,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonRawArraysInRawType.kt")
|
||||
public void testNonRawArraysInRawType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonRawArraysInRawType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonTrivialErasure.kt")
|
||||
public void testNonTrivialErasure() throws Exception {
|
||||
|
||||
+6
@@ -24187,6 +24187,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonRawArraysInRawType.kt")
|
||||
public void testNonRawArraysInRawType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonRawArraysInRawType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonTrivialErasure.kt")
|
||||
public void testNonTrivialErasure() throws Exception {
|
||||
|
||||
+6
@@ -24187,6 +24187,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonRawArraysInRawType.kt")
|
||||
public void testNonRawArraysInRawType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonRawArraysInRawType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonTrivialErasure.kt")
|
||||
public void testNonTrivialErasure() throws Exception {
|
||||
|
||||
@@ -68,6 +68,16 @@ object CompilerConeAttributes {
|
||||
override fun toString(): String = "@ExtensionFunctionType"
|
||||
}
|
||||
|
||||
object RawType : ConeAttribute<RawType>() {
|
||||
override fun union(other: RawType?): RawType? = other
|
||||
override fun intersect(other: RawType?): RawType? = other
|
||||
override fun add(other: RawType?): RawType = this
|
||||
override fun isSubtypeOf(other: RawType?): Boolean = true
|
||||
|
||||
override val key: KClass<out RawType> = RawType::class
|
||||
override fun toString(): String = "Raw type"
|
||||
}
|
||||
|
||||
class ContextFunctionTypeParams(val contextReceiverNumber: Int) : ConeAttribute<ContextFunctionTypeParams>() {
|
||||
override fun union(other: ContextFunctionTypeParams?): ContextFunctionTypeParams? = other
|
||||
override fun intersect(other: ContextFunctionTypeParams?): ContextFunctionTypeParams = this
|
||||
|
||||
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.types
|
||||
import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassifierLookupTag
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.types.model.*
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.foldMap
|
||||
@@ -184,10 +185,32 @@ data class ConeDefinitelyNotNullType(val original: ConeSimpleKotlinType) : ConeS
|
||||
companion object
|
||||
}
|
||||
|
||||
class ConeRawType(
|
||||
class ConeRawType private constructor(
|
||||
lowerBound: ConeSimpleKotlinType,
|
||||
upperBound: ConeSimpleKotlinType
|
||||
) : ConeFlexibleType(lowerBound, upperBound), RawTypeMarker
|
||||
) : ConeFlexibleType(lowerBound, upperBound), RawTypeMarker {
|
||||
companion object {
|
||||
fun create(
|
||||
lowerBound: ConeSimpleKotlinType,
|
||||
upperBound: ConeSimpleKotlinType,
|
||||
): ConeRawType {
|
||||
require(lowerBound is ConeClassLikeType && upperBound is ConeClassLikeType) {
|
||||
"Raw bounds are expected to be class-like types, but $lowerBound and $upperBound were found"
|
||||
}
|
||||
|
||||
val lowerBoundToUse = if (!lowerBound.attributes.contains(CompilerConeAttributes.RawType)) {
|
||||
ConeClassLikeTypeImpl(
|
||||
lowerBound.lookupTag, lowerBound.typeArguments, lowerBound.isNullable,
|
||||
lowerBound.attributes + CompilerConeAttributes.RawType
|
||||
)
|
||||
} else {
|
||||
lowerBound
|
||||
}
|
||||
|
||||
return ConeRawType(lowerBoundToUse, upperBound)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Contract of the intersection type: it is flat. It means that
|
||||
|
||||
@@ -123,7 +123,7 @@ private fun JavaType?.toConeTypeProjection(
|
||||
else -> lowerBound
|
||||
}
|
||||
|
||||
if (isRaw) ConeRawType(finalLowerBound, upperBound) else ConeFlexibleType(finalLowerBound, upperBound)
|
||||
if (isRaw) ConeRawType.create(finalLowerBound, upperBound) else ConeFlexibleType(finalLowerBound, upperBound)
|
||||
}
|
||||
|
||||
is JavaArrayType -> {
|
||||
|
||||
@@ -50,7 +50,7 @@ private fun ConeKotlinType.enhanceConeKotlinType(
|
||||
|
||||
when {
|
||||
lowerResult == null && upperResult == null -> null
|
||||
this is ConeRawType -> ConeRawType(lowerResult ?: lowerBound, upperResult ?: upperBound)
|
||||
this is ConeRawType -> ConeRawType.create(lowerResult ?: lowerBound, upperResult ?: upperBound)
|
||||
else -> coneFlexibleOrSimpleType(session.typeContext, lowerResult ?: lowerBound, upperResult ?: upperBound)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,16 +9,17 @@ import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.expressions.FirSmartCastExpression
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeRawScopeSubstitutor
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap
|
||||
import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator
|
||||
import org.jetbrains.kotlin.fir.scopes.FirTypeScope
|
||||
import org.jetbrains.kotlin.fir.scopes.FirUnstableSmartcastTypeScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.*
|
||||
import org.jetbrains.kotlin.fir.scopes.scopeForClass
|
||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||
@@ -61,10 +62,17 @@ private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: Scope
|
||||
|
||||
fir.symbol.lazyResolveToPhase(requiredPhase)
|
||||
|
||||
val substitution = createSubstitution(fir.typeParameters, fullyExpandedType, useSiteSession)
|
||||
val substitutor = when {
|
||||
attributes.contains(CompilerConeAttributes.RawType) -> ConeRawScopeSubstitutor(useSiteSession)
|
||||
else -> substitutorByMap(
|
||||
createSubstitution(fir.typeParameters, fullyExpandedType, useSiteSession),
|
||||
useSiteSession,
|
||||
)
|
||||
}
|
||||
|
||||
fir.scopeForClass(substitutorByMap(substitution, useSiteSession), useSiteSession, scopeSession)
|
||||
fir.scopeForClass(substitutor, useSiteSession, scopeSession)
|
||||
}
|
||||
|
||||
is ConeTypeParameterType -> {
|
||||
val symbol = lookupTag.symbol
|
||||
scopeSession.getOrBuild(symbol, TYPE_PARAMETER_SCOPE_KEY) {
|
||||
@@ -75,6 +83,7 @@ private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: Scope
|
||||
intersectionType.scope(useSiteSession, scopeSession, requiredPhase) ?: FirTypeScope.Empty
|
||||
}
|
||||
}
|
||||
|
||||
is ConeRawType -> lowerBound.scope(useSiteSession, scopeSession, requiredPhase)
|
||||
is ConeDynamicType -> useSiteSession.dynamicMembersStorage.getDynamicScopeFor(scopeSession)
|
||||
is ConeFlexibleType -> lowerBound.scope(useSiteSession, scopeSession, requiredPhase)
|
||||
@@ -86,6 +95,7 @@ private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: Scope
|
||||
},
|
||||
this
|
||||
)
|
||||
|
||||
is ConeDefinitelyNotNullType -> original.scope(useSiteSession, scopeSession, requiredPhase)
|
||||
is ConeIntegerConstantOperatorType -> scopeSession.getOrBuildScopeForIntegerConstantOperatorType(useSiteSession, this)
|
||||
is ConeIntegerLiteralConstantType -> error("ILT should not be in receiver position")
|
||||
@@ -93,6 +103,13 @@ private fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: Scope
|
||||
}
|
||||
}
|
||||
|
||||
private fun ConeClassLikeType.obtainFirOfClass(useSiteSession: FirSession, requiredPhase: FirResolvePhase): FirClass? {
|
||||
val fullyExpandedType = fullyExpandedType(useSiteSession)
|
||||
val fir = fullyExpandedType.lookupTag.toSymbol(useSiteSession)?.fir as? FirClass ?: return null
|
||||
|
||||
return fir.also { it.symbol.lazyResolveToPhase(requiredPhase) }
|
||||
}
|
||||
|
||||
fun FirClassSymbol<*>.defaultType(): ConeClassLikeType = fir.defaultType()
|
||||
|
||||
fun FirClass.defaultType(): ConeClassLikeType =
|
||||
|
||||
+53
@@ -6,11 +6,14 @@
|
||||
package org.jetbrains.kotlin.fir.resolve.substitution
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.resolve.withCombinedAttributesFrom
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.name.StandardClassIds
|
||||
import org.jetbrains.kotlin.types.TypeApproximatorConfiguration
|
||||
import org.jetbrains.kotlin.types.model.TypeConstructorMarker
|
||||
import org.jetbrains.kotlin.types.model.TypeSubstitutorMarker
|
||||
@@ -221,6 +224,56 @@ class ConeSubstitutorByMap(
|
||||
override fun hashCode() = hashCode
|
||||
}
|
||||
|
||||
class ConeRawScopeSubstitutor(
|
||||
private val useSiteSession: FirSession,
|
||||
) : AbstractConeSubstitutor(useSiteSession.typeContext) {
|
||||
override fun substituteType(type: ConeKotlinType): ConeKotlinType? {
|
||||
return when {
|
||||
type is ConeTypeParameterType -> {
|
||||
substituteOrSelf(
|
||||
listOf(type.lookupTag.symbol).eraseToUpperBounds(useSiteSession)[0] as ConeKotlinType
|
||||
)
|
||||
}
|
||||
type is ConeClassLikeType && type.typeArguments.isNotEmpty() -> {
|
||||
if (type.lookupTag.classId == StandardClassIds.Array) {
|
||||
val argument = type.typeArguments[0]
|
||||
val erasedType = argument.type?.let(this::substituteOrSelf)
|
||||
|
||||
return type.withArguments(
|
||||
arrayOf(erasedType?.toTypeProjection(argument.kind) ?: ConeStarProjection)
|
||||
)
|
||||
}
|
||||
|
||||
val firClass = type.fullyExpandedType(useSiteSession).lookupTag.toFirRegularClassSymbol(useSiteSession) ?: return null
|
||||
ConeRawType.create(
|
||||
type.withArguments(firClass.typeParameterSymbols.eraseToUpperBounds(useSiteSession)),
|
||||
type.replaceArgumentsWithStarProjections()
|
||||
)
|
||||
}
|
||||
type is ConeFlexibleType -> {
|
||||
val substitutedLowerBound = substituteOrNull(type.lowerBound)
|
||||
val substitutedUpperBound = substituteOrNull(type.upperBound)
|
||||
if (substitutedLowerBound == null && substitutedUpperBound == null) return null
|
||||
|
||||
val newLowerBound = substitutedLowerBound?.lowerBoundIfFlexible() ?: type.lowerBound
|
||||
val newUpperBound = substitutedUpperBound?.upperBoundIfFlexible() ?: type.upperBound
|
||||
|
||||
if (substitutedLowerBound is ConeRawType || substitutedUpperBound is ConeRawType) {
|
||||
return ConeRawType.create(newLowerBound, newUpperBound)
|
||||
}
|
||||
|
||||
ConeFlexibleType(newLowerBound, newUpperBound)
|
||||
}
|
||||
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?) = other is ConeRawScopeSubstitutor
|
||||
|
||||
override fun hashCode(): Int = 0
|
||||
}
|
||||
|
||||
fun createTypeSubstitutorByTypeConstructor(
|
||||
map: Map<TypeConstructorMarker, ConeKotlinType>,
|
||||
context: ConeTypeContext,
|
||||
|
||||
+18
-17
@@ -10,19 +10,17 @@ import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.FirSessionComponent
|
||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.classId
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.delegateFields
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isExpect
|
||||
import org.jetbrains.kotlin.fir.resolve.*
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeRawScopeSubstitutor
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.*
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeErrorType
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
|
||||
class FirKotlinScopeProvider(
|
||||
val declaredMemberScopeDecorator: (
|
||||
@@ -125,19 +123,22 @@ fun ConeKotlinType.scopeForSupertype(
|
||||
): FirTypeScope? {
|
||||
if (this !is ConeClassLikeType) return null
|
||||
if (this is ConeErrorType) return null
|
||||
val symbol = lookupTag.toSymbol(useSiteSession)
|
||||
return if (symbol is FirRegularClassSymbol) {
|
||||
symbol.fir.scopeForClassImpl(
|
||||
substitutor(symbol, this, useSiteSession),
|
||||
useSiteSession,
|
||||
scopeSession,
|
||||
skipPrivateMembers = true,
|
||||
classFirDispatchReceiver = subClass,
|
||||
isFromExpectClass = (subClass as? FirRegularClass)?.isExpect == true
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
||||
val symbol = lookupTag.toSymbol(useSiteSession) as? FirRegularClassSymbol ?: return null
|
||||
|
||||
val substitutor = when {
|
||||
this.type.attributes.contains(CompilerConeAttributes.RawType) -> ConeRawScopeSubstitutor(useSiteSession)
|
||||
else -> substitutor(symbol, this, useSiteSession)
|
||||
}
|
||||
|
||||
return symbol.fir.scopeForClassImpl(
|
||||
substitutor,
|
||||
useSiteSession,
|
||||
scopeSession,
|
||||
skipPrivateMembers = true,
|
||||
classFirDispatchReceiver = subClass,
|
||||
isFromExpectClass = (subClass as? FirRegularClass)?.isExpect == true
|
||||
)
|
||||
}
|
||||
|
||||
private fun substitutor(symbol: FirRegularClassSymbol, type: ConeClassLikeType, useSiteSession: FirSession): ConeSubstitutor {
|
||||
@@ -165,7 +166,7 @@ private fun FirClass.scopeForClassImpl(
|
||||
useSiteSession,
|
||||
basicScope,
|
||||
key, substitutor,
|
||||
substitutor.substituteOrSelf(classFirDispatchReceiver.defaultType()) as ConeClassLikeType,
|
||||
substitutor.substituteOrSelf(classFirDispatchReceiver.defaultType()).lowerBoundIfFlexible() as ConeClassLikeType,
|
||||
skipPrivateMembers,
|
||||
makeExpect = isFromExpectClass
|
||||
)
|
||||
|
||||
+4
-3
@@ -21,8 +21,8 @@ import org.jetbrains.kotlin.fir.scopes.FakeOverrideSubstitution
|
||||
import org.jetbrains.kotlin.fir.scopes.FirTypeScope
|
||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.runIf
|
||||
@@ -118,7 +118,7 @@ class FirClassSubstitutionScope(
|
||||
}
|
||||
|
||||
private fun ConeSimpleKotlinType.substitute(substitutor: ConeSubstitutor): ConeSimpleKotlinType? {
|
||||
return substitutor.substituteOrNull(this) as ConeSimpleKotlinType?
|
||||
return substitutor.substituteOrNull(this)?.lowerBoundIfFlexible()
|
||||
}
|
||||
|
||||
fun createSubstitutionOverrideFunction(original: FirNamedFunctionSymbol): FirNamedFunctionSymbol {
|
||||
@@ -212,7 +212,8 @@ class FirClassSubstitutionScope(
|
||||
constructor,
|
||||
FirDeclarationOrigin.SubstitutionOverride,
|
||||
newDispatchReceiverType,
|
||||
newReturnType,
|
||||
// Constructors' return types are expected to be non-flexible (i.e., non raw)
|
||||
newReturnType?.lowerBoundIfFlexible(),
|
||||
newParameterTypes,
|
||||
newContextReceiverTypes,
|
||||
newTypeParameters,
|
||||
|
||||
@@ -140,7 +140,7 @@ fun <T : ConeKotlinType> T.withAttributes(attributes: ConeAttributes): T {
|
||||
is ConeClassLikeTypeImpl -> ConeClassLikeTypeImpl(lookupTag, typeArguments, nullability.isNullable, attributes)
|
||||
is ConeDefinitelyNotNullType -> ConeDefinitelyNotNullType(original.withAttributes(attributes))
|
||||
is ConeTypeParameterTypeImpl -> ConeTypeParameterTypeImpl(lookupTag, nullability.isNullable, attributes)
|
||||
is ConeRawType -> ConeRawType(lowerBound.withAttributes(attributes), upperBound.withAttributes(attributes))
|
||||
is ConeRawType -> ConeRawType.create(lowerBound.withAttributes(attributes), upperBound.withAttributes(attributes))
|
||||
is ConeDynamicType -> ConeDynamicType(lowerBound.withAttributes(attributes), upperBound.withAttributes(attributes))
|
||||
is ConeFlexibleType -> ConeFlexibleType(lowerBound.withAttributes(attributes), upperBound.withAttributes(attributes))
|
||||
is ConeTypeVariableType -> ConeTypeVariableType(nullability, lookupTag, attributes)
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// SKIP_TXT
|
||||
// FILE: A.java
|
||||
|
||||
public class A {
|
||||
public static B getB() { return null; }
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
|
||||
public class B<E> {
|
||||
public void foo(java.util.Map<String, String> x) {}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main(x: Map<Any, Any>) {
|
||||
A.getB().foo(<!ARGUMENT_TYPE_MISMATCH!>x<!>) // OK in FE1.0 ( but probably shouldn't), ARGUMENT_TYPE_MISMATCH at FIR
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
// FILE: A.java
|
||||
|
||||
@@ -13,5 +14,5 @@ public class B<E> {
|
||||
|
||||
// FILE: main.kt
|
||||
fun main(x: Map<Any, Any>) {
|
||||
A.getB().foo(x) // OK in FE1.0 ( but probably shouldn't), ARGUMENT_TYPE_MISMATCH at FIR
|
||||
A.getB().foo(x)
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ fun main() {
|
||||
raw.charSequences = arrayOf<String>()
|
||||
raw.charSequences = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<Double>()<!>
|
||||
|
||||
raw.maps = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<Map<Int, Int>>()<!>
|
||||
raw.maps = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<MutableMap<Int, Int>>()<!>
|
||||
raw.maps = arrayOf<Map<Int, Int>>()
|
||||
raw.maps = arrayOf<MutableMap<Int, Int>>()
|
||||
raw.maps = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<List<String>>()<!>
|
||||
|
||||
raw.arraysOfLists = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<Array<List<*>>>()<!>
|
||||
raw.arraysOfLists = arrayOf<Array<List<*>>>()
|
||||
raw.arraysOfLists = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<List<String>>()<!>
|
||||
raw.arraysOfLists = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<Array<Array<String>>>()<!>
|
||||
|
||||
raw.arraysOfAny = arrayOf<Array<Array<String>>>()
|
||||
|
||||
raw.erasedLists = <!ASSIGNMENT_TYPE_MISMATCH!>arrayOf<List<String>>()<!>
|
||||
raw.erasedLists = arrayOf<List<String>>()
|
||||
}
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class A<T> {
|
||||
|
||||
void foo(T x) {}
|
||||
|
||||
public class Inner<E> {
|
||||
Inner(E x0, T x, List<T> y) {}
|
||||
|
||||
void foo(E x0, T x, List<T> y) {}
|
||||
A<Map<E, T>> bar() {}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static A rawAField = null;
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
val strList: List<String> = null!!
|
||||
|
||||
fun main() {
|
||||
val rawA = Test.rawAField
|
||||
var rawInner = rawA.Inner<Double>(<!ARGUMENT_TYPE_MISMATCH!>""<!>, "", strList)
|
||||
rawInner.foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>, "", strList)
|
||||
rawInner.bar().foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// SKIP_TXT
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: Generic.java
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Generic<T> {
|
||||
|
||||
public static class ML<E> {}
|
||||
public static Generic create() { return null; }
|
||||
|
||||
public String[] getFoo()
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main() {
|
||||
val generic = Generic.create()
|
||||
|
||||
for (x in generic.foo) {
|
||||
x.length // Arrays don't become raw
|
||||
}
|
||||
|
||||
for (x in generic.getFoo()) {
|
||||
x.length // Arrays don't become raw
|
||||
}
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class A<T> {
|
||||
List<T> x;
|
||||
|
||||
void foo(T x, List<T> y) {}
|
||||
|
||||
A<List<T>> bar() {}
|
||||
}
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static class RawADerived extends A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
val strList: List<String> = null!!
|
||||
val strMap: Map<String, String> = null!!
|
||||
|
||||
fun main() {
|
||||
val rawADerived = Test.RawADerived()
|
||||
rawADerived.x = strList
|
||||
rawADerived.foo("", strList)
|
||||
|
||||
|
||||
val rawA = rawADerived.bar()
|
||||
rawA.x = <!ASSIGNMENT_TYPE_MISMATCH!>strList<!>
|
||||
rawA.foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>, <!ARGUMENT_TYPE_MISMATCH!>strList<!>)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class A<T extends CharSequence> {
|
||||
A<List<T>> foo(T x, Map<String, List<T>> y, HashMap<T, T> z) {}
|
||||
|
||||
void bar(List<Double[]>[][] d) {}
|
||||
}
|
||||
|
||||
// FILE: RawADerived.java
|
||||
|
||||
public class RawADerived extends A {
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import java.util.*;
|
||||
|
||||
class B1 : RawADerived() {
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: CharSequence, y: Map<Any?, Any?>, z: HashMap<Any, Any>): A<*> = null!!
|
||||
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun bar(d: Array<Array<List<*>>>) {}
|
||||
}
|
||||
|
||||
class B2 : RawADerived() {
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: CharSequence?, y: MutableMap<Any?, Any?>, z: HashMap<Any?, Any?>): A<String> = null!!
|
||||
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun bar(d: Array<Array<MutableList<*>>>) {}
|
||||
}
|
||||
|
||||
class B3 : RawADerived() {
|
||||
// Type of second parameter (y) is not equal to overridden
|
||||
// RawADerived.foo.y --- (MutableMap<Any?, Any?>..Map<out Any?, out Any?>) is not a subtype of Map<Any?, Any>
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: CharSequence, y: Map<Any?, Any>, z: HashMap<Any, Any>): A<*> = null!!
|
||||
}
|
||||
|
||||
class B4 : RawADerived() {
|
||||
// Type of first parameter is not equal to overridden
|
||||
override fun bar(d: Array<Array<MutableList<Array<Double>>>>) {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
+5
-4
@@ -26,16 +26,17 @@ public class Test {
|
||||
// FILE: main.kt
|
||||
|
||||
fun foo(x: B<*>) {
|
||||
// TODO: x.foo() now is flexible type instead of raw, because of captured type approximation
|
||||
val q: MutableList<String> = x.foo().getChildrenStubs()
|
||||
// TODO: In K1, x.foo() now is flexible type instead of raw, because of captured type approximation
|
||||
// Works in K2 as expected: x.foo() returns raw `A`, thus it's `getChildrenStubs` has a type `MutableList<Any!>..List<*>?`
|
||||
val q: MutableList<String> = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>x.foo().getChildrenStubs()<!>
|
||||
|
||||
// Raw(B).field erased to A<Any!>..A<out Any!>?
|
||||
Test.rawB.field = A<String>()
|
||||
val anyA: A<Any> = <!INITIALIZER_TYPE_MISMATCH!>Test.rawB.field<!>
|
||||
val anyA: A<Any> = Test.rawB.field
|
||||
|
||||
// FIR doesn't work here, because
|
||||
// field has a type of just 'A' and it's not clear why should it accept 'String' at consume
|
||||
// NB: some kind of BareTypeScope should be in use here
|
||||
Test.rawB.field.consume(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
||||
Test.rawB.field.consume("")
|
||||
val y: Any = Test.rawB.field.produce()
|
||||
}
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@ public class Test {
|
||||
// FILE: main.kt
|
||||
|
||||
fun foo(x: B<*>) {
|
||||
// TODO: x.foo() now is flexible type instead of raw, because of captured type approximation
|
||||
// TODO: In K1, x.foo() now is flexible type instead of raw, because of captured type approximation
|
||||
// Works in K2 as expected: x.foo() returns raw `A`, thus it's `getChildrenStubs` has a type `MutableList<Any!>..List<*>?`
|
||||
val q: MutableList<String> = x.foo().getChildrenStubs()
|
||||
|
||||
// Raw(B).field erased to A<Any!>..A<out Any!>?
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class A<T> {
|
||||
List<T> x;
|
||||
Map<T, T> y;
|
||||
|
||||
A<Map<String, T>> z;
|
||||
|
||||
void foo(T x, List<T> y, List<Map<Integer, T>> z) {}
|
||||
|
||||
A<List<T>> bar() {}
|
||||
}
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static A rawAField = null;
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
val strList: List<String> = null!!
|
||||
val strMap: Map<String, String> = null!!
|
||||
|
||||
fun main() {
|
||||
val rawA = Test.rawAField
|
||||
rawA.x = strList
|
||||
rawA.y = <!ASSIGNMENT_TYPE_MISMATCH!>strMap<!>
|
||||
rawA.foo("", strList, <!ARGUMENT_TYPE_MISMATCH!>strList<!>)
|
||||
|
||||
val barResult = rawA.bar()
|
||||
|
||||
barResult.x = <!ASSIGNMENT_TYPE_MISMATCH!>strList<!>
|
||||
barResult.y = <!ASSIGNMENT_TYPE_MISMATCH!>strMap<!>
|
||||
barResult.foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>, <!ARGUMENT_TYPE_MISMATCH!>strList<!>, null)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
// FILE: A.java
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
import java.util.*;
|
||||
|
||||
class A<T> {
|
||||
@NotNull
|
||||
List<String> foo(@NotNull T x, @Nullable List<String> y) {}
|
||||
}
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
static class DerivedRawA extends A {}
|
||||
|
||||
static A rawField = null;
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
val doubleList: List<Double?> = null!!
|
||||
|
||||
fun main() {
|
||||
Test.rawField.foo("", <!ARGUMENT_TYPE_MISMATCH!>doubleList<!>)
|
||||
Test.rawField.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, <!ARGUMENT_TYPE_MISMATCH!>doubleList<!>)
|
||||
Test.DerivedRawA().foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, <!ARGUMENT_TYPE_MISMATCH!>doubleList<!>)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.java
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
@@ -5,8 +5,8 @@ public open class RawOverrides : R|kotlin/Any| {
|
||||
public abstract fun <E : R|kotlin/CharSequence!|> foo(x: R|ft<T & Any, T?>|, y: R|ft<kotlin/collections/MutableList<out ft<T & Any, T?>>, kotlin/collections/List<out ft<T & Any, T?>>?>|): R|ft<E & Any, E?>|
|
||||
|
||||
}
|
||||
public open inner class B : R|kotlin/Any|, R|test/RawOverrides.A<kotlin/Any!>| {
|
||||
@R|java/lang/Override|() public open fun foo(x: R|kotlin/Any!|, y: R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|kotlin/String!|
|
||||
public open inner class B : R|kotlin/Any|, R|Raw type test/RawOverrides.A<kotlin/Any!>| {
|
||||
@R|java/lang/Override|() public open fun foo(x: R|kotlin/Any!|, y: R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|kotlin/String!|
|
||||
|
||||
public test/RawOverrides.constructor(): R|test/RawOverrides.B|
|
||||
|
||||
@@ -18,7 +18,7 @@ public open class RawOverrides : R|kotlin/Any| {
|
||||
|
||||
}
|
||||
public open inner class D : R|test/RawOverrides.C| {
|
||||
@R|java/lang/Override|() public open fun bar(x: R|kotlin/CharSequence!|, y: R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|kotlin/String!|
|
||||
@R|java/lang/Override|() public open fun bar(x: R|kotlin/CharSequence!|, y: R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|kotlin/String!|
|
||||
|
||||
public/*package*/ open fun <E : R|kotlin/CharSequence!|, F : R|ft<E & Any, E?>|> bar(x: R|ft<F & Any, F?>|, y: R|ft<kotlin/collections/MutableList<ft<kotlin/collections/MutableMap<ft<E & Any, E?>, ft<F & Any, F?>>, kotlin/collections/Map<ft<E & Any, E?>, ft<F & Any, F?>>?>>, kotlin/collections/List<ft<kotlin/collections/MutableMap<ft<E & Any, E?>, ft<F & Any, F?>>, kotlin/collections/Map<ft<E & Any, E?>, ft<F & Any, F?>>?>>?>|): R|ft<E & Any, E?>|
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
public abstract interface RawTypeWithUpperBound : R|kotlin/Any| {
|
||||
public abstract interface Bar : R|kotlin/Any| {
|
||||
public abstract fun f(f: R|ft<test/RawTypeWithUpperBound.Foo<kotlin/CharSequence!>, test/RawTypeWithUpperBound.Foo<*>?>|): R|kotlin/Unit|
|
||||
public abstract fun f(f: R|ft<Raw type test/RawTypeWithUpperBound.Foo<kotlin/CharSequence!>, test/RawTypeWithUpperBound.Foo<*>?>|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun g(f: R|ft<kotlin/collections/MutableList<ft<test/RawTypeWithUpperBound.Foo<kotlin/CharSequence!>, test/RawTypeWithUpperBound.Foo<*>?>>, kotlin/collections/List<ft<test/RawTypeWithUpperBound.Foo<kotlin/CharSequence!>, test/RawTypeWithUpperBound.Foo<*>?>>?>|): R|kotlin/Unit|
|
||||
public abstract fun g(f: R|ft<kotlin/collections/MutableList<ft<Raw type test/RawTypeWithUpperBound.Foo<kotlin/CharSequence!>, test/RawTypeWithUpperBound.Foo<*>?>>, kotlin/collections/List<ft<Raw type test/RawTypeWithUpperBound.Foo<kotlin/CharSequence!>, test/RawTypeWithUpperBound.Foo<*>?>>?>|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract interface Foo<T : R|kotlin/CharSequence!|> : R|kotlin/Any| {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
public open class ReferenceCycleThroughAnnotation : R|kotlin/Any| {
|
||||
public constructor(): R|test/ReferenceCycleThroughAnnotation|
|
||||
|
||||
@R|test/ReferenceCycleThroughAnnotation.C|(value = <getClass>(<getClass>(R|ft<test/ReferenceCycleThroughAnnotation.B<ft<test/ReferenceCycleThroughAnnotation.A<*>, test/ReferenceCycleThroughAnnotation.A<*>?>>, test/ReferenceCycleThroughAnnotation.B<*>?>|))) public open inner class A<T : R|kotlin/Any!|> : R|kotlin/Any| {
|
||||
@R|test/ReferenceCycleThroughAnnotation.C|(value = <getClass>(<getClass>(R|ft<Raw type test/ReferenceCycleThroughAnnotation.B<ft<test/ReferenceCycleThroughAnnotation.A<*>, test/ReferenceCycleThroughAnnotation.A<*>?>>, test/ReferenceCycleThroughAnnotation.B<*>?>|))) public open inner class A<T : R|kotlin/Any!|> : R|kotlin/Any| {
|
||||
public open fun foo(): R|kotlin/Unit|
|
||||
|
||||
public test/ReferenceCycleThroughAnnotation.constructor<T : R|kotlin/Any!|>(): R|test/ReferenceCycleThroughAnnotation.A<T>|
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ public open class ClassObjectArrayInParam : R|kotlin/Any| {
|
||||
public constructor(vararg value: R|kotlin/Array<kotlin/reflect/KClass<*>>|): R|test/ClassObjectArrayInParam.Anno|
|
||||
|
||||
}
|
||||
@R|test/ClassObjectArrayInParam.Anno|(value = <implicitArrayOf>(<getClass>(<getClass>(R|test/ClassObjectArrayInParam!|)), <getClass>(<getClass>(R|test/ClassObjectArrayInParam.Nested!|)), <getClass>(<getClass>(R|kotlin/String!|)), <getClass>(<getClass>(R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|)), <getClass>(<getClass>(R|ft<kotlin/Array<ft<kotlin/Array<kotlin/String!>, kotlin/Array<out kotlin/String!>?>>, kotlin/Array<out ft<kotlin/Array<kotlin/String!>, kotlin/Array<out kotlin/String!>?>>?>|)), <getClass>(<getClass>(R|ft<kotlin/Array<kotlin/IntArray!>, kotlin/Array<out kotlin/IntArray!>?>|)), <getClass>(<getClass>(R|kotlin/Unit|)))) public open class Nested : R|kotlin/Any| {
|
||||
@R|test/ClassObjectArrayInParam.Anno|(value = <implicitArrayOf>(<getClass>(<getClass>(R|test/ClassObjectArrayInParam!|)), <getClass>(<getClass>(R|test/ClassObjectArrayInParam.Nested!|)), <getClass>(<getClass>(R|kotlin/String!|)), <getClass>(<getClass>(R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|)), <getClass>(<getClass>(R|ft<kotlin/Array<ft<kotlin/Array<kotlin/String!>, kotlin/Array<out kotlin/String!>?>>, kotlin/Array<out ft<kotlin/Array<kotlin/String!>, kotlin/Array<out kotlin/String!>?>>?>|)), <getClass>(<getClass>(R|ft<kotlin/Array<kotlin/IntArray!>, kotlin/Array<out kotlin/IntArray!>?>|)), <getClass>(<getClass>(R|kotlin/Unit|)))) public open class Nested : R|kotlin/Any| {
|
||||
public constructor(): R|test/ClassObjectArrayInParam.Nested|
|
||||
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ public open class Rendering : R|kotlin/Any| {
|
||||
|
||||
}
|
||||
public/*package*/ abstract interface H_Raw : R|kotlin/Any| {
|
||||
public abstract fun foo1(x: R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|kotlin/Unit|
|
||||
public abstract fun foo1(x: R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun foo2(x: R|ft<test/Rendering.D_SuperG<kotlin/Any!>, test/Rendering.D_SuperG<*>?>|): R|kotlin/Unit|
|
||||
public abstract fun foo2(x: R|ft<Raw type test/Rendering.D_SuperG<kotlin/Any!>, test/Rendering.D_SuperG<*>?>|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public/*package*/ abstract interface I_Wildcard : R|kotlin/Any| {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
public open class RawSuperType : R|kotlin/Any| {
|
||||
public constructor(): R|test/RawSuperType|
|
||||
|
||||
public open inner class Derived : R|kotlin/Any|, R|test/RawSuperType.Super<kotlin/Any!>| {
|
||||
public open inner class Derived : R|kotlin/Any|, R|Raw type test/RawSuperType.Super<kotlin/Any!>| {
|
||||
@R|java/lang/Override|() public open fun foo(o: R|kotlin/Any!|): R|kotlin/Unit|
|
||||
|
||||
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ public open class RawSuperTypeWithBound : R|kotlin/Any| {
|
||||
|
||||
public abstract interface Bound : R|kotlin/Any| {
|
||||
}
|
||||
public open inner class Derived : R|kotlin/Any|, R|test/RawSuperTypeWithBound.Super<test/RawSuperTypeWithBound.Bound!>| {
|
||||
public open inner class Derived : R|kotlin/Any|, R|Raw type test/RawSuperTypeWithBound.Super<test/RawSuperTypeWithBound.Bound!>| {
|
||||
public open fun foo(o: R|kotlin/Any!|): R|kotlin/Unit|
|
||||
|
||||
@R|java/lang/Override|() public open fun foo(o: R|test/RawSuperTypeWithBound.Bound!|): R|kotlin/Unit|
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
public open class RawSuperTypeWithRecursiveBound : R|kotlin/Any| {
|
||||
public constructor(): R|test/RawSuperTypeWithRecursiveBound|
|
||||
|
||||
public open inner class Derived : R|kotlin/Any|, R|test/RawSuperTypeWithRecursiveBound.Super<ft<test/RawSuperTypeWithRecursiveBound.Super<*>, test/RawSuperTypeWithRecursiveBound.Super<*>?>>| {
|
||||
public open inner class Derived : R|kotlin/Any|, R|Raw type test/RawSuperTypeWithRecursiveBound.Super<ft<test/RawSuperTypeWithRecursiveBound.Super<*>, test/RawSuperTypeWithRecursiveBound.Super<*>?>>| {
|
||||
public open fun foo(o: R|kotlin/Any!|): R|kotlin/Unit|
|
||||
|
||||
@R|java/lang/Override|() public open fun foo(o: R|ft<test/RawSuperTypeWithRecursiveBound.Super<ft<test/RawSuperTypeWithRecursiveBound.Super<*>, test/RawSuperTypeWithRecursiveBound.Super<*>?>>, test/RawSuperTypeWithRecursiveBound.Super<*>?>|): R|kotlin/Unit|
|
||||
@R|java/lang/Override|() public open fun foo(o: R|ft<Raw type test/RawSuperTypeWithRecursiveBound.Super<ft<test/RawSuperTypeWithRecursiveBound.Super<*>, test/RawSuperTypeWithRecursiveBound.Super<*>?>>, test/RawSuperTypeWithRecursiveBound.Super<*>?>|): R|kotlin/Unit|
|
||||
|
||||
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
|
||||
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
public open class RawSuperTypeWithRecursiveBoundMultipleParameters : R|kotlin/Any| {
|
||||
public constructor(): R|test/RawSuperTypeWithRecursiveBoundMultipleParameters|
|
||||
|
||||
public open inner class Derived : R|kotlin/Any|, R|test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>>| {
|
||||
public open inner class Derived : R|kotlin/Any|, R|Raw type test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>>| {
|
||||
public open fun foo(o: R|kotlin/Any!|, o1: R|kotlin/Any!|): R|kotlin/Unit|
|
||||
|
||||
@R|java/lang/Override|() public open fun foo(r: R|kotlin/Any!|, t: R|ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>|): R|kotlin/Unit|
|
||||
@R|java/lang/Override|() public open fun foo(r: R|kotlin/Any!|, t: R|ft<Raw type test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin/Any!, ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>?>|): R|kotlin/Unit|
|
||||
|
||||
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
|
||||
|
||||
|
||||
+8
-8
@@ -4,33 +4,33 @@ public abstract interface SubclassWithRawType : R|kotlin/Any| {
|
||||
|
||||
public abstract fun simple2(): R|ft<kotlin/collections/MutableList<ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>, kotlin/collections/List<ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>?>|
|
||||
|
||||
public abstract fun simple3(): R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
public abstract fun simple3(): R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
|
||||
public abstract fun boundWildcard1(): R|ft<kotlin/collections/MutableList<out ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>, kotlin/collections/List<out ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>?>|
|
||||
|
||||
public abstract fun boundWildcard2(): R|ft<kotlin/collections/MutableList<in ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/collections/MutableList<in ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
public abstract fun boundWildcard2(): R|ft<kotlin/collections/MutableList<in ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/collections/MutableList<in ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
|
||||
public abstract fun wildcard(): R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
public abstract fun wildcard(): R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
|
||||
public abstract fun array1(): R|ft<kotlin/Array<ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>, kotlin/Array<out ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>?>|
|
||||
|
||||
public abstract fun array2(): R|ft<kotlin/Array<ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/Array<out ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
public abstract fun array2(): R|ft<kotlin/Array<ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/Array<out ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
|
||||
}
|
||||
public abstract interface Super : R|kotlin/Any| {
|
||||
public abstract fun simple1(): R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
public abstract fun simple1(): R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
|
||||
public abstract fun simple2(): R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
public abstract fun simple2(): R|ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|
|
||||
|
||||
public abstract fun simple3(): R|ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>|
|
||||
|
||||
public abstract fun boundWildcard1(): R|ft<kotlin/collections/MutableList<out ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/collections/List<out ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
public abstract fun boundWildcard1(): R|ft<kotlin/collections/MutableList<out ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/collections/List<out ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
|
||||
public abstract fun boundWildcard2(): R|ft<kotlin/collections/MutableList<in ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>, kotlin/collections/MutableList<in ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>?>|
|
||||
|
||||
public abstract fun wildcard(): R|ft<kotlin/collections/MutableList<*>, kotlin/collections/List<*>?>|
|
||||
|
||||
public abstract fun array1(): R|ft<kotlin/Array<ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/Array<out ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
public abstract fun array1(): R|ft<kotlin/Array<ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>, kotlin/Array<out ft<Raw type kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>>?>|
|
||||
|
||||
public abstract fun array2(): R|ft<kotlin/Array<ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>, kotlin/Array<out ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>>?>|
|
||||
|
||||
|
||||
Generated
+6
@@ -24193,6 +24193,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonRawArraysInRawType.kt")
|
||||
public void testNonRawArraysInRawType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonRawArraysInRawType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonTrivialErasure.kt")
|
||||
public void testNonTrivialErasure() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user