[AA] check symbol pointer restoring without psi anchor
^KT-54311
This commit is contained in:
committed by
Space Team
parent
636024f676
commit
4bd604f2ed
+4
-2
@@ -46,8 +46,10 @@ internal class KtFe10DescSyntheticFieldSymbol(
|
||||
override fun createPointer(): KtSymbolPointer<KtVariableLikeSymbol> = withValidityAssertion {
|
||||
val accessorPsi = descriptor.containingDeclaration.toSourceElement.getPsi()
|
||||
if (accessorPsi is KtPropertyAccessor) {
|
||||
val accessorPointer = KtPsiBasedSymbolPointer<KtPropertyAccessorSymbol>(accessorPsi.createSmartPointer())
|
||||
return KtFe10DescSyntheticFieldSymbolPointer(accessorPointer)
|
||||
val accessorPointer = KtPsiBasedSymbolPointer.createForSymbolFromPsi<KtPropertyAccessorSymbol>(accessorPsi)
|
||||
if (accessorPointer != null) {
|
||||
return KtFe10DescSyntheticFieldSymbolPointer(accessorPointer)
|
||||
}
|
||||
}
|
||||
|
||||
return KtFe10NeverRestoringSymbolPointer()
|
||||
|
||||
+87
-13
@@ -7,11 +7,15 @@ package org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.components.KtDeclarationRendererOptions
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K2
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE_K1
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE_K2
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.PRETTY_RENDERING_MODE
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.*
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtPsiBasedSymbolPointer
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer
|
||||
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiSingleFileTest
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind
|
||||
@@ -20,7 +24,9 @@ import org.jetbrains.kotlin.analysis.utils.printer.prettyPrint
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.directives.model.Directive
|
||||
import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
|
||||
import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer
|
||||
import org.jetbrains.kotlin.test.directives.model.singleOrZeroValue
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.assertions
|
||||
@@ -42,19 +48,32 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiSingleFileTest() {
|
||||
|
||||
override fun doTestByFileStructure(ktFile: KtFile, module: TestModule, testServices: TestServices) {
|
||||
val directives = module.directives
|
||||
val directiveToIgnore = DO_NOT_CHECK_SYMBOL_RESTORE.takeIf { it in directives }
|
||||
?: DO_NOT_CHECK_SYMBOL_RESTORE_K1.takeIf { configurator.frontendKind == FrontendKind.Fe10 && it in directives }
|
||||
?: DO_NOT_CHECK_SYMBOL_RESTORE_K2.takeIf { configurator.frontendKind == FrontendKind.Fir && it in directives }
|
||||
val directiveToIgnoreSymbolRestore = directives.doNotCheckSymbolRestoreDirective()
|
||||
val directiveToIgnoreNonPsiSymbolRestore = directives.doNotCheckNonPsiSymbolRestoreDirective()
|
||||
|
||||
val renderMode = directives[PRETTY_RENDERING_MODE].singleOrNull()
|
||||
val prettyRenderOptions = when (renderMode ?: prettyRenderMode) {
|
||||
val prettyRenderOptions = when (directives.singleOrZeroValue(PRETTY_RENDERING_MODE) ?: prettyRenderMode) {
|
||||
PrettyRenderingMode.RENDER_SYMBOLS_LINE_BY_LINE -> renderingOptions
|
||||
PrettyRenderingMode.RENDER_SYMBOLS_NESTED -> renderingOptions.copy(renderClassMembers = true)
|
||||
}
|
||||
|
||||
fun KtSymbol.safePointer(): KtSymbolPointer<KtSymbol>? {
|
||||
val result = kotlin.runCatching { createPointer() }
|
||||
return if (directiveToIgnore == null) result.getOrThrow() else result.getOrNull()
|
||||
fun KtSymbol.safePointer(): PointerWrapper? {
|
||||
val regularPointer = runCatching(::createPointer).let {
|
||||
if (directiveToIgnoreSymbolRestore == null) it.getOrThrow() else it.getOrNull()
|
||||
} ?: return null
|
||||
|
||||
val nonPsiPointer = kotlin.runCatching {
|
||||
if (this is KtFileSymbol) return@runCatching null
|
||||
|
||||
KtPsiBasedSymbolPointer.withDisabledPsiBasedPointers(::createPointer)
|
||||
}
|
||||
|
||||
return PointerWrapper(
|
||||
regularPointer = regularPointer,
|
||||
pointerWithoutPsiAnchor = if (directiveToIgnoreSymbolRestore == null && directiveToIgnoreNonPsiSymbolRestore == null)
|
||||
nonPsiPointer.getOrThrow()
|
||||
else
|
||||
nonPsiPointer.getOrNull(),
|
||||
)
|
||||
}
|
||||
|
||||
val pointersWithRendered = executeOnPooledThreadInReadAction {
|
||||
@@ -93,9 +112,45 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiSingleFileTest() {
|
||||
|
||||
configurator.doOutOfBlockModification(ktFile)
|
||||
|
||||
restoreSymbolsInOtherReadActionAndCompareResults(directiveToIgnore, ktFile, pointersWithRendered.pointers, testServices)
|
||||
restoreSymbolsInOtherReadActionAndCompareResults(
|
||||
directiveToIgnore = directiveToIgnoreSymbolRestore,
|
||||
pointerAccessor = PointerWrapper::regularPointer,
|
||||
ktFile = ktFile,
|
||||
pointersWithRendered = pointersWithRendered.pointers,
|
||||
testServices = testServices,
|
||||
)
|
||||
|
||||
if (directiveToIgnoreSymbolRestore == null) {
|
||||
restoreSymbolsInOtherReadActionAndCompareResults(
|
||||
directiveToIgnore = directiveToIgnoreNonPsiSymbolRestore,
|
||||
pointerAccessor = PointerWrapper::pointerWithoutPsiAnchor,
|
||||
ktFile = ktFile,
|
||||
pointersWithRendered = pointersWithRendered.pointers,
|
||||
testServices = testServices,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun RegisteredDirectives.doNotCheckSymbolRestoreDirective(): Directive? = findSpecificDirective(
|
||||
commonDirective = DO_NOT_CHECK_SYMBOL_RESTORE,
|
||||
k1Directive = DO_NOT_CHECK_SYMBOL_RESTORE_K1,
|
||||
k2Directive = DO_NOT_CHECK_SYMBOL_RESTORE_K2,
|
||||
)
|
||||
|
||||
private fun RegisteredDirectives.doNotCheckNonPsiSymbolRestoreDirective(): Directive? = findSpecificDirective(
|
||||
commonDirective = DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE,
|
||||
k1Directive = DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1,
|
||||
k2Directive = DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K2,
|
||||
)
|
||||
|
||||
private fun RegisteredDirectives.findSpecificDirective(
|
||||
commonDirective: Directive,
|
||||
k1Directive: Directive,
|
||||
k2Directive: Directive,
|
||||
): Directive? = commonDirective.takeIf { it in this }
|
||||
?: k1Directive.takeIf { configurator.frontendKind == FrontendKind.Fe10 && it in this }
|
||||
?: k2Directive.takeIf { configurator.frontendKind == FrontendKind.Fir && it in this }
|
||||
|
||||
private fun compareResults(
|
||||
data: SymbolPointersData,
|
||||
testServices: TestServices,
|
||||
@@ -116,6 +171,7 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiSingleFileTest() {
|
||||
|
||||
private fun restoreSymbolsInOtherReadActionAndCompareResults(
|
||||
directiveToIgnore: Directive?,
|
||||
pointerAccessor: (PointerWrapper) -> KtSymbolPointer<KtSymbol>?,
|
||||
ktFile: KtFile,
|
||||
pointersWithRendered: List<PointerWithRenderedSymbol>,
|
||||
testServices: TestServices,
|
||||
@@ -123,12 +179,13 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiSingleFileTest() {
|
||||
var failed = false
|
||||
try {
|
||||
val restored = analyseForTest(ktFile) {
|
||||
pointersWithRendered.map { (pointer, expectedRender) ->
|
||||
val restored = pointer!!.restoreSymbol() ?: error("Symbol $expectedRender was not restored")
|
||||
|
||||
pointersWithRendered.map { (pointerWrapper, expectedRender) ->
|
||||
val pointer = pointerWrapper?.let(pointerAccessor) ?: error("Symbol pointer for $expectedRender was not created")
|
||||
val restored = pointer.restoreSymbol() ?: error("Symbol $expectedRender was not restored")
|
||||
renderSymbolForComparison(restored)
|
||||
}
|
||||
}
|
||||
|
||||
val actual = restored.renderAsDeclarations()
|
||||
testServices.assertions.assertEqualsToTestDataFileSibling(actual)
|
||||
} catch (e: Throwable) {
|
||||
@@ -164,6 +221,18 @@ object SymbolTestDirectives : SimpleDirectivesContainer() {
|
||||
description = "Symbol restoring for some symbols in current test is not supported yet in K2",
|
||||
)
|
||||
|
||||
val DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE by directive(
|
||||
description = "Symbol restoring w/o psi for some symbols in current test is not supported yet",
|
||||
)
|
||||
|
||||
val DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1 by directive(
|
||||
description = "Symbol restoring w/o psi for some symbols in current test is not supported yet in K1",
|
||||
)
|
||||
|
||||
val DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K2 by directive(
|
||||
description = "Symbol restoring w/o psi for some symbols in current test is not supported yet in K2",
|
||||
)
|
||||
|
||||
val PRETTY_RENDERING_MODE by enumDirective(description = "Explicit rendering mode") { PrettyRenderingMode.valueOf(it) }
|
||||
}
|
||||
|
||||
@@ -183,6 +252,11 @@ private data class SymbolPointersData(
|
||||
)
|
||||
|
||||
private data class PointerWithRenderedSymbol(
|
||||
val pointer: KtSymbolPointer<*>?,
|
||||
val pointer: PointerWrapper?,
|
||||
val rendered: String,
|
||||
)
|
||||
|
||||
private data class PointerWrapper(
|
||||
val regularPointer: KtSymbolPointer<*>,
|
||||
val pointerWithoutPsiAnchor: KtSymbolPointer<*>?,
|
||||
)
|
||||
|
||||
+24
-3
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.symbols.pointers
|
||||
|
||||
import com.intellij.psi.SmartPsiElementPointer
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbolOrigin
|
||||
@@ -15,7 +16,7 @@ import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtObjectLiteralExpression
|
||||
import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer
|
||||
|
||||
public class KtPsiBasedSymbolPointer<S : KtSymbol>(private val psiPointer: SmartPsiElementPointer<out KtElement>) :
|
||||
public class KtPsiBasedSymbolPointer<S : KtSymbol> private constructor(private val psiPointer: SmartPsiElementPointer<out KtElement>) :
|
||||
KtSymbolPointer<S>() {
|
||||
@Deprecated("Consider using org.jetbrains.kotlin.analysis.api.KtAnalysisSession.restoreSymbol")
|
||||
override fun restoreSymbol(analysisSession: KtAnalysisSession): S? {
|
||||
@@ -35,7 +36,7 @@ public class KtPsiBasedSymbolPointer<S : KtSymbol>(private val psiPointer: Smart
|
||||
|
||||
public companion object {
|
||||
public fun <S : KtSymbol> createForSymbolFromSource(symbol: S): KtPsiBasedSymbolPointer<S>? {
|
||||
if (symbol.origin != KtSymbolOrigin.SOURCE) return null
|
||||
if (disablePsiPointer || symbol.origin != KtSymbolOrigin.SOURCE) return null
|
||||
|
||||
val psi = when (val psi = symbol.psi) {
|
||||
is KtDeclaration -> psi
|
||||
@@ -46,5 +47,25 @@ public class KtPsiBasedSymbolPointer<S : KtSymbol>(private val psiPointer: Smart
|
||||
|
||||
return KtPsiBasedSymbolPointer(psi.createSmartPointer())
|
||||
}
|
||||
|
||||
public fun <S : KtSymbol> createForSymbolFromPsi(ktElement: KtElement): KtPsiBasedSymbolPointer<S>? {
|
||||
if (disablePsiPointer) return null
|
||||
|
||||
return KtPsiBasedSymbolPointer(ktElement.createSmartPointer())
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@Synchronized
|
||||
public fun <T> withDisabledPsiBasedPointers(action: () -> T): T {
|
||||
disablePsiPointer = true
|
||||
return try {
|
||||
action()
|
||||
} finally {
|
||||
disablePsiPointer = false
|
||||
}
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var disablePsiPointer: Boolean = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
enum class E {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class Foo
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass1
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
class SomeClass
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
package test
|
||||
|
||||
interface ClassA
|
||||
|
||||
analysis/analysis-api/testData/symbols/singleSymbolByPsi/errors/anonympuseObjectInInvalidPosition.kt
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
private val _commonSettingsLazy: A = null = ob<caret>ject : A<Int> {
|
||||
override fun x() {}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
private val commonSettingsLazy = o<caret>bject A<LanguageVersionSettings> {
|
||||
println(x)
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
annotation class ReceiverAnnotation
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class ReceiverTypeAnnotation
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
annotation class PropertyAnnotation
|
||||
annotation class FieldAnnotation
|
||||
annotation class GetAnnotation
|
||||
|
||||
Vendored
+2
-1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
annotation class PropertyAnnotation
|
||||
annotation class GetAnnotation
|
||||
annotation class ExplicitGetAnnotation
|
||||
@@ -9,4 +10,4 @@ annotation class ReceiverTypeAnnotation
|
||||
@property:PropertyAnnotation
|
||||
@get:GetAnnotation
|
||||
val @receiver:ReceiverAnnotation @ReceiverTypeAnnotation Long.x: Int
|
||||
@ExplicitGetAnnotation ge<caret>t() = 1
|
||||
@ExplicitGetAnnotation ge<caret>t() = 1
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// WITH_STDLIB
|
||||
|
||||
annotation class PropertyAnnotation
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// PRETTY_RENDERING_MODE: RENDER_SYMBOLS_NESTED
|
||||
|
||||
annotation class PropertyAnnotation
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// WITH_STDLIB
|
||||
|
||||
annotation class PropertyAnnotation
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
annotation class ReceiverAnnotation
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class ReceiverTypeAnnotation
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
annotation class PropertyAnnotation
|
||||
annotation class FieldAnnotation
|
||||
annotation class GetAnnotation
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
annotation class Anno(val param1: String, val param2: Int)
|
||||
|
||||
@Anno(param1 = "param", 2)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class AnonymousContainer {
|
||||
val anonymousObject = object : Runnable {
|
||||
override fun run() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
var p: Int
|
||||
get() = field
|
||||
set(value) {
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
class A {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class A {
|
||||
val i: Int
|
||||
init {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class A {
|
||||
val a: Int = 10
|
||||
fun x() = 10
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
class A(val a: Int, b: String) {
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
class A() {
|
||||
constructor(x: Int): this()
|
||||
constructor(y: Int, z: String) : this(y)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
import org.jetbrains.annotations.NotNull
|
||||
class A<@NotNull T, R> {
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
context(kotlin.Int, s@kotlin.String)
|
||||
class A {
|
||||
constructor(int: Int) {}
|
||||
|
||||
Vendored
+1
@@ -1,2 +1,3 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
context(Int, s@String)
|
||||
fun y(){}
|
||||
Vendored
+1
@@ -1,2 +1,3 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
context(Int, s@String)
|
||||
val y get() = 10
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// WITH_STDLIB
|
||||
|
||||
class MyColor(val x: Int, val y: Int, val z: Int)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// WITH_STDLIB
|
||||
|
||||
@Deprecated("don't use i")
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
data class P(val x: Int, val y: Int)
|
||||
|
||||
fun destruct(): Int {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class Foo {
|
||||
val p : dynamic = null
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
enum class X {
|
||||
Y, Z;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
enum class Style(val value: String) {
|
||||
SHEET("foo") {
|
||||
override val exitAnimation: String
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
var p: Int
|
||||
field = "test"
|
||||
get() = field.length
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun String.foo(): Int = 10
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
fun usage() {
|
||||
for (loopVariable in 1..10) {}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun foo(x: Int) {}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
fun <X> foo(x: X) {}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class A {
|
||||
constructor(i: Int)
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun foo(): Int = 10
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
fun foo() {
|
||||
val lam1 = { a: Int ->
|
||||
val b = 1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// WITH_STDLIB
|
||||
|
||||
@JvmField
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
// WITH_STDLIB
|
||||
|
||||
class Foo {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
fun yyy() {
|
||||
val q = 10
|
||||
fun aaa() {}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
class A {
|
||||
fun x(): Int
|
||||
fun y()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
class A {
|
||||
val x: Int = 10
|
||||
val Int.y get() = this
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class X<T> {
|
||||
inner class Y<T1>
|
||||
class Z<T2>
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun x(): Int = 10
|
||||
fun y() {}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
val x: Int = 10
|
||||
val Int.y get() = this
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
class X<T>
|
||||
|
||||
private typealias Y<Z> = X<Z>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno1
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
inline fun foo(
|
||||
inlineParameter: () -> Int,
|
||||
crossinline crossinlineParameter: () -> Int,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
fun primitive(vararg a: Int)
|
||||
fun nullablePrimitive(vararg b: Float?)
|
||||
fun nonPrimitive(vararg c: Any)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
annotation class PropertyAnnotation
|
||||
annotation class FieldAnnotation
|
||||
annotation class GetAnnotation
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
inline fun <T, R> T.use(block: (T) -> R): R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
// IGNORE_FE10
|
||||
|
||||
package test
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
annotation class ReceiverAnnotation
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class ReceiverTypeAnnotation
|
||||
|
||||
Reference in New Issue
Block a user