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:
Denis Zharkov
2015-09-04 12:24:42 +03:00
parent 31244edec9
commit 4159c83282
7 changed files with 86 additions and 8 deletions
@@ -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)
}
}
}