[FIR] Skip resolvable package names in front of UNRESOLVED_REFERENCE
#KT-55471
This commit is contained in:
committed by
Space Team
parent
10f7989af6
commit
1c446151e7
Vendored
+9
-9
@@ -45,7 +45,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
TYPES:
|
TYPES:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types](ElementType#.TYPE_USE#) public? final? [ResolvedTo(TYPES)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types](ElementType#.TYPE_USE#) public? final? [ResolvedTo(TYPES)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
STATUS:
|
STATUS:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(STATUS)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(STATUS)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
EXPECT_ACTUAL_MATCHING:
|
EXPECT_ACTUAL_MATCHING:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
ARGUMENTS_OF_ANNOTATIONS:
|
ARGUMENTS_OF_ANNOTATIONS:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
CONTRACTS:
|
CONTRACTS:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(CONTRACTS)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(CONTRACTS)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
IMPLICIT_TYPES_BODY_RESOLVE:
|
IMPLICIT_TYPES_BODY_RESOLVE:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types](ElementType#.TYPE_USE#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
ANNOTATIONS_ARGUMENTS_MAPPING:
|
ANNOTATIONS_ARGUMENTS_MAPPING:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types]() public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types]() public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
BODY_RESOLVE:
|
BODY_RESOLVE:
|
||||||
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types]() public final [ResolvedTo(BODY_RESOLVE)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types]() public final [ResolvedTo(BODY_RESOLVE)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationClassWithJavaTarget.kt
|
|||||||
|
|
||||||
FILE RAW TO BODY:
|
FILE RAW TO BODY:
|
||||||
FILE: [ResolvedTo(BODY_RESOLVE)] annotationClassWithJavaTarget.kt
|
FILE: [ResolvedTo(BODY_RESOLVE)] annotationClassWithJavaTarget.kt
|
||||||
@<ERROR TYPE REF: Symbol not found for java.lang.annotation.Target>[Types]() public final [ResolvedTo(BODY_RESOLVE)] annotation class ResolveMe : R|kotlin/Annotation| {
|
@<ERROR TYPE REF: Symbol not found for java>[Types]() public final [ResolvedTo(BODY_RESOLVE)] annotation class ResolveMe : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=ResolveMe] constructor(): R|ResolveMe| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -437,12 +437,12 @@ FILE: [ResolvedTo(IMPORTS)] annotationParameters.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A.X>): R|Anno| {
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A>): R|Anno| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A.X> = R|<local>/args|
|
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A> = R|<local>/args|
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A.X>
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A>
|
||||||
|
|
||||||
}
|
}
|
||||||
public final [ResolvedTo(STATUS)] class B : R|kotlin/Any| {
|
public final [ResolvedTo(STATUS)] class B : R|kotlin/Any| {
|
||||||
@@ -476,12 +476,12 @@ FILE: [ResolvedTo(IMPORTS)] annotationParameters.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A.X>): R|Anno| {
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A>): R|Anno| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A.X> = R|<local>/args|
|
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A> = R|<local>/args|
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A.X>
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A>
|
||||||
|
|
||||||
}
|
}
|
||||||
public final [ResolvedTo(STATUS)] class B : R|kotlin/Any| {
|
public final [ResolvedTo(STATUS)] class B : R|kotlin/Any| {
|
||||||
@@ -515,12 +515,12 @@ FILE: [ResolvedTo(BODY_RESOLVE)] annotationParameters.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| {
|
public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A.X>): R|Anno| {
|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A>): R|Anno| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A.X> = R|<local>/args|
|
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A> = R|<local>/args|
|
||||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A.X>
|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A>
|
||||||
|
|
||||||
}
|
}
|
||||||
public final [ResolvedTo(BODY_RESOLVE)] class B : R|kotlin/Any| {
|
public final [ResolvedTo(BODY_RESOLVE)] class B : R|kotlin/Any| {
|
||||||
|
|||||||
+9
-9
@@ -519,12 +519,12 @@ FILE: [ResolvedTo(IMPORTS)] annotationParametersScript.kts
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A.X>): R|Anno| {
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A>): R|Anno| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A.X> = R|<local>/args|
|
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A> = R|<local>/args|
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A.X>
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,12 +565,12 @@ FILE: [ResolvedTo(IMPORTS)] annotationParametersScript.kts
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A.X>): R|Anno| {
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A>): R|Anno| {
|
||||||
LAZY_super<R|kotlin/Any|>
|
LAZY_super<R|kotlin/Any|>
|
||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A.X> = R|<local>/args|
|
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A> = R|<local>/args|
|
||||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A.X>
|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,12 +611,12 @@ FILE: [ResolvedTo(BODY_RESOLVE)] annotationParametersScript.kts
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| {
|
public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| {
|
||||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A.X>): R|Anno| {
|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.args] args: <ERROR TYPE REF: Symbol not found for A>): R|Anno| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A.X> = R|<local>/args|
|
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val args: <ERROR TYPE REF: Symbol not found for A> = R|<local>/args|
|
||||||
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A.X>
|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for A>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-1
@@ -22,12 +22,14 @@ import org.jetbrains.kotlin.fir.resolve.FirTypeResolutionResult
|
|||||||
import org.jetbrains.kotlin.fir.resolve.SupertypeSupplier
|
import org.jetbrains.kotlin.fir.resolve.SupertypeSupplier
|
||||||
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnresolvedTypeQualifierError
|
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnresolvedTypeQualifierError
|
||||||
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnsupportedDefaultValueInFunctionType
|
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnsupportedDefaultValueInFunctionType
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
||||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
||||||
import org.jetbrains.kotlin.fir.resolve.typeResolver
|
import org.jetbrains.kotlin.fir.resolve.typeResolver
|
||||||
import org.jetbrains.kotlin.fir.types.*
|
import org.jetbrains.kotlin.fir.types.*
|
||||||
import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef
|
import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.builder.buildUserTypeRef
|
import org.jetbrains.kotlin.fir.types.builder.buildUserTypeRef
|
||||||
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.util.PrivateForInline
|
import org.jetbrains.kotlin.util.PrivateForInline
|
||||||
|
|
||||||
class FirSpecificTypeResolverTransformer(
|
class FirSpecificTypeResolverTransformer(
|
||||||
@@ -195,7 +197,9 @@ class FirSpecificTypeResolverTransformer(
|
|||||||
|
|
||||||
if (diagnostic is ConeUnresolvedTypeQualifierError) {
|
if (diagnostic is ConeUnresolvedTypeQualifierError) {
|
||||||
val totalQualifierCount = diagnostic.qualifiers.size
|
val totalQualifierCount = diagnostic.qualifiers.size
|
||||||
val resolvedQualifierCount = (partiallyResolvedTypeRef?.delegatedTypeRef as? FirUserTypeRef)?.qualifier?.size ?: 0
|
val resolvedQualifierCount = (partiallyResolvedTypeRef?.delegatedTypeRef as? FirUserTypeRef)?.qualifier?.size
|
||||||
|
?: calculatePartiallyResolvablePackageSegments(diagnostic.qualifiers)
|
||||||
|
|
||||||
val unresolvedQualifierCount = totalQualifierCount - resolvedQualifierCount
|
val unresolvedQualifierCount = totalQualifierCount - resolvedQualifierCount
|
||||||
|
|
||||||
if (unresolvedQualifierCount > 1) {
|
if (unresolvedQualifierCount > 1) {
|
||||||
@@ -207,6 +211,7 @@ class FirSpecificTypeResolverTransformer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to calculate a partially resolved type reference for a type reference which was resolved to an error type.
|
* Tries to calculate a partially resolved type reference for a type reference which was resolved to an error type.
|
||||||
* It will attempt to resolve the type with a decreasing number of qualifiers until it succeeds, allowing
|
* It will attempt to resolve the type with a decreasing number of qualifiers until it succeeds, allowing
|
||||||
@@ -242,6 +247,32 @@ class FirSpecificTypeResolverTransformer(
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the given [qualifiers] are interpreted as a fully qualified name,
|
||||||
|
* calculates how many segments (from the left) can be resolved to an existing package.
|
||||||
|
*
|
||||||
|
* This is useful for providing better IDE support when resolving partially incorrect types.
|
||||||
|
*
|
||||||
|
* The last segment is never considered, i.e., if [qualifiers] is not empty, the result is always `< qualifiers.size`.
|
||||||
|
*/
|
||||||
|
private fun calculatePartiallyResolvablePackageSegments(qualifiers: List<FirQualifierPart>): Int {
|
||||||
|
if (qualifiers.size <= 1) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
val packageSegmentsToTry = qualifiers.mapTo(mutableListOf()) { it.name.asString() }
|
||||||
|
|
||||||
|
while (packageSegmentsToTry.size > 1) {
|
||||||
|
packageSegmentsToTry.removeLast()
|
||||||
|
if (session.symbolProvider.getPackage(FqName.fromSegments(packageSegmentsToTry)) != null) {
|
||||||
|
return packageSegmentsToTry.size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
private fun ConeKotlinType.takeIfAcceptable(): ConeKotlinType? = this.takeUnless {
|
private fun ConeKotlinType.takeIfAcceptable(): ConeKotlinType? = this.takeUnless {
|
||||||
!errorTypeAsResolved && it is ConeErrorType
|
!errorTypeAsResolved && it is ConeErrorType
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// ISSUE: KT-58549
|
// ISSUE: KT-58549
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
val x: <!UNRESOLVED_REFERENCE!>kotlin.Cloneable<!> = if (true) intArrayOf(1) else longArrayOf(1)
|
val x: kotlin.<!UNRESOLVED_REFERENCE!>Cloneable<!> = if (true) intArrayOf(1) else longArrayOf(1)
|
||||||
x
|
x
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<!> as Com
|
|||||||
val l : MutableList<in Int> = ArrayList<Int>()
|
val l : MutableList<in Int> = ArrayList<Int>()
|
||||||
|
|
||||||
fun test(l : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>) {
|
fun test(l : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>) {
|
||||||
val <!UNUSED_VARIABLE!>x<!> : <!UNRESOLVED_REFERENCE!>java<!>.List
|
val <!UNUSED_VARIABLE!>x<!> : java.<!UNRESOLVED_REFERENCE!>List<!>
|
||||||
val <!UNUSED_VARIABLE!>y<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>
|
val <!UNUSED_VARIABLE!>y<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>
|
||||||
val <!UNUSED_VARIABLE!>b<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Object<!>
|
val <!UNUSED_VARIABLE!>b<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Object<!>
|
||||||
val <!UNUSED_VARIABLE!>z<!> : <!UNRESOLVED_REFERENCE!>java<!>.utils.List<Int>
|
val <!UNUSED_VARIABLE!>z<!> : java.<!UNRESOLVED_REFERENCE!>utils<!>.List<Int>
|
||||||
|
|
||||||
val <!UNUSED_VARIABLE!>f<!> : java.io.File? = null
|
val <!UNUSED_VARIABLE!>f<!> : java.io.File? = null
|
||||||
|
|
||||||
|
|||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
@<!UNRESOLVED_REFERENCE!>Ann<!> class A
|
|
||||||
@<!UNRESOLVED_REFERENCE!>Ann<!> class B
|
|
||||||
@<!UNRESOLVED_REFERENCE!>Ann<!>(1) class C
|
|
||||||
@<!UNRESOLVED_REFERENCE!>kotlin<!>.Ann(1) class D
|
|
||||||
@<!UNRESOLVED_REFERENCE!>kotlin<!>.annotation.Ann(1) class E
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
@<!UNRESOLVED_REFERENCE!>Ann<!> class A
|
@<!UNRESOLVED_REFERENCE!>Ann<!> class A
|
||||||
@<!UNRESOLVED_REFERENCE!>Ann<!> class B
|
@<!UNRESOLVED_REFERENCE!>Ann<!> class B
|
||||||
@<!UNRESOLVED_REFERENCE!>Ann<!>(1) class C
|
@<!UNRESOLVED_REFERENCE!>Ann<!>(1) class C
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ object DefaultHttpClientWithFun : HttpClient by fClient() {
|
|||||||
|
|
||||||
private fun fClient() = HttpClientImpl()
|
private fun fClient() = HttpClientImpl()
|
||||||
|
|
||||||
private fun <T> lazy(init: () -> T): <!UNRESOLVED_REFERENCE!>kotlin<!>.Lazy<T> {
|
private fun <T> lazy(init: () -> T): kotlin.<!UNRESOLVED_REFERENCE!>Lazy<!><T> {
|
||||||
init()
|
init()
|
||||||
null!!
|
null!!
|
||||||
}
|
}
|
||||||
|
|||||||
compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.fir.kt
Vendored
-4
@@ -1,4 +0,0 @@
|
|||||||
// SKIP_JAVAC
|
|
||||||
typealias Test1 = <!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
|
|
||||||
typealias Test2 = <!UNRESOLVED_REFERENCE!>kotlin<!>.SuspendFunction0<Unit>
|
|
||||||
typealias Test3 = kotlin.coroutines.SuspendFunction0<Unit>
|
|
||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// SKIP_JAVAC
|
// SKIP_JAVAC
|
||||||
typealias Test1 = <!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
|
typealias Test1 = <!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
|
||||||
typealias Test2 = kotlin.<!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
|
typealias Test2 = kotlin.<!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:11:12: error: unresolved reference 'javax.swing.JFrame'.
|
compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:11:18: error: unresolved reference 'swing'.
|
||||||
val s: javax.swing.JFrame? = null
|
val s: javax.swing.JFrame? = null
|
||||||
^
|
^
|
||||||
compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:12:5: error: overload resolution ambiguity between candidates: [@InlineOnly() fun println(message: Any?): Unit, @InlineOnly() fun println(message: Boolean): Unit, @InlineOnly() fun println(message: Byte): Unit, ...]
|
compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:12:5: error: overload resolution ambiguity between candidates: [@InlineOnly() fun println(message: Any?): Unit, @InlineOnly() fun println(message: Boolean): Unit, @InlineOnly() fun println(message: Byte): Unit, ...]
|
||||||
println(s)
|
println(s)
|
||||||
^
|
^
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
compiler/testData/javaModules/releaseFlag/moduleSwing/foo/Foo.kt:5:12: error: unresolved reference 'javax.swing.JFrame'.
|
compiler/testData/javaModules/releaseFlag/moduleSwing/foo/Foo.kt:5:18: error: unresolved reference 'swing'.
|
||||||
val z: javax.swing.JFrame? = null
|
val z: javax.swing.JFrame? = null
|
||||||
^
|
^
|
||||||
COMPILATION_ERROR
|
COMPILATION_ERROR
|
||||||
|
|||||||
Reference in New Issue
Block a user