Support decapitilized obsolete annotations in resolve
Annotations like `deprecated`, `jvmStatic`, etc. has been renamed to capitilized themselves. But we're going to support both versions. It's hard just to leave both versions of classes as their class-files can clash when compiled on register-independent file system. So here is solution (temporary hack): we just wrap JetScopes for package fragments of `kotlin.*` to make them search both versions of annotations if their names are contained in our hardcoded set.
This commit is contained in:
+2
-1
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.JetFile
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
import org.jetbrains.kotlin.resolve.scopes.DecapitalizedAnnotationScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.JetScope
|
||||
import org.jetbrains.kotlin.serialization.PackageData
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
@@ -105,7 +106,7 @@ public class IncrementalPackageFragmentProvider(
|
||||
JetScope.Empty
|
||||
}
|
||||
else {
|
||||
IncrementalPackageScope(JvmProtoBufUtil.readPackageDataFrom(packageDataBytes))
|
||||
DecapitalizedAnnotationScope.wrapIfNeeded(IncrementalPackageScope(JvmProtoBufUtil.readPackageDataFrom(packageDataBytes)), fqName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user