[Analysis API] add test for duplicated callable during implicit type
^KT-63547
This commit is contained in:
committed by
Space Team
parent
51f6525238
commit
e3841a1728
+6
@@ -58,6 +58,12 @@ public class Fe10IdeNormalAnalysisSourceModuleCollectDiagnosticsTestGenerated ex
|
||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/declarationErrors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("duplicatedCallableWithImplicitType.kt")
|
||||
public void testDuplicatedCallableWithImplicitType() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/duplicatedCallableWithImplicitType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incompleteDelegation.kt")
|
||||
public void testIncompleteDelegation() throws Exception {
|
||||
|
||||
+6
@@ -58,6 +58,12 @@ public class FirIdeNormalAnalysisSourceModuleCollectDiagnosticsTestGenerated ext
|
||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/declarationErrors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("duplicatedCallableWithImplicitType.kt")
|
||||
public void testDuplicatedCallableWithImplicitType() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/duplicatedCallableWithImplicitType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incompleteDelegation.kt")
|
||||
public void testIncompleteDelegation() throws Exception {
|
||||
|
||||
+6
@@ -58,6 +58,12 @@ public class FirStandaloneNormalAnalysisSourceModuleCollectDiagnosticsTestGenera
|
||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/declarationErrors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("duplicatedCallableWithImplicitType.kt")
|
||||
public void testDuplicatedCallableWithImplicitType() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/duplicatedCallableWithImplicitType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incompleteDelegation.kt")
|
||||
public void testIncompleteDelegation() throws Exception {
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
Diagnostics from elements:
|
||||
for PSI element of type KtCallExpression at (24,20) - (27,2)
|
||||
TYPE_MISMATCH text ranges: [(98,160)]
|
||||
PSI: KtCallExpression at (24,20) - (27,2)
|
||||
for PSI element of type KtLambdaExpression at (24,24) - (27,2)
|
||||
TYPE_MISMATCH text ranges: [(102,160)]
|
||||
PSI: KtLambdaExpression at (24,24) - (27,2)
|
||||
for PSI element of type KtNameReferenceExpression at (25,5-17)
|
||||
UNRESOLVED_REFERENCE text ranges: [(108,120)]
|
||||
PSI: KtNameReferenceExpression at (25,5-17)
|
||||
for PSI element of type KtNameReferenceExpression at (26,5-34)
|
||||
UNRESOLVED_REFERENCE text ranges: [(127,156)]
|
||||
PSI: KtNameReferenceExpression at (26,5-34)
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// DISABLE_SEALED_INHERITOR_CALCULATOR
|
||||
// MODULE: lib1
|
||||
// FILE: dependency.kt
|
||||
package usage
|
||||
|
||||
fun implicitType() = 1
|
||||
|
||||
// MODULE: dep(lib1)
|
||||
// FILE: annotation.kt
|
||||
package usage
|
||||
|
||||
fun implicitTypeFromAnotherModule() = implicitType()
|
||||
|
||||
// MODULE: lib2
|
||||
// FILE: dependency.kt
|
||||
package usage
|
||||
|
||||
fun implicitType() = "str"
|
||||
|
||||
// MODULE: main(lib2, dep)
|
||||
// FILE: usage.kt
|
||||
package usage
|
||||
|
||||
fun usage(): Int = run {
|
||||
implicitType()
|
||||
implicitTypeFromAnotherModule()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
Diagnostics from elements:
|
||||
for PSI element of type KtCallExpression at (26,5-36)
|
||||
ARGUMENT_TYPE_MISMATCH text ranges: [(127,158)]
|
||||
PSI: KtCallExpression at (26,5-36)
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// SKIP_WHEN_OUT_OF_CONTENT_ROOT
|
||||
// DISABLE_SEALED_INHERITOR_CALCULATOR
|
||||
// MODULE: lib1
|
||||
// FILE: dependency.kt
|
||||
package usage
|
||||
|
||||
fun implicitType() = 1
|
||||
|
||||
// MODULE: dep(lib1)
|
||||
// FILE: annotation.kt
|
||||
package usage
|
||||
|
||||
fun implicitTypeFromAnotherModule() = implicitType()
|
||||
|
||||
// MODULE: lib2
|
||||
// FILE: dependency.kt
|
||||
package usage
|
||||
|
||||
fun implicitType() = "str"
|
||||
|
||||
// MODULE: main(lib2, dep)
|
||||
// FILE: usage.kt
|
||||
package usage
|
||||
|
||||
fun usa<caret>ge() = run {
|
||||
implicitType()
|
||||
implicitTypeFromAnotherModule()
|
||||
}
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
RAW_FIR:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] usage.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
IMPORTS:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
COMPILER_REQUIRED_ANNOTATIONS:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
COMPANION_GENERATION:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public? final? [ResolvedTo(COMPANION_GENERATION)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
SUPER_TYPES:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public? final? [ResolvedTo(SUPER_TYPES)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
TYPES:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public? final? [ResolvedTo(TYPES)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
STATUS:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public final [ResolvedTo(STATUS)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
EXPECT_ACTUAL_MATCHING:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
CONTRACTS:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] annotation.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitTypeFromAnotherModule(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public final [ResolvedTo(CONTRACTS)] fun usage(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
IMPLICIT_TYPES_BODY_RESOLVE:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] annotation.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitTypeFromAnotherModule(): R|kotlin/String| {
|
||||
^implicitTypeFromAnotherModule R|usage/implicitType|()
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] dependency.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|kotlin/String| {
|
||||
^implicitType String(str)
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun usage(): R|kotlin/String| {
|
||||
^usage R|kotlin/run|<R|kotlin/String|>(<L> = [ResolvedTo(RAW_FIR)] [MatchingParameterFunctionTypeKey=kotlin/Function0<R>] run@fun <anonymous>(): R|kotlin/String| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|usage/implicitType|()
|
||||
^ R|usage/implicitTypeFromAnotherModule|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
ANNOTATION_ARGUMENTS:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] annotation.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitTypeFromAnotherModule(): R|kotlin/String| {
|
||||
^implicitTypeFromAnotherModule R|usage/implicitType|()
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] dependency.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|kotlin/String| {
|
||||
^implicitType String(str)
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun usage(): R|kotlin/String| {
|
||||
^usage R|kotlin/run|<R|kotlin/String|>(<L> = [ResolvedTo(RAW_FIR)] [MatchingParameterFunctionTypeKey=kotlin/Function0<R>] run@fun <anonymous>(): R|kotlin/String| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|usage/implicitType|()
|
||||
^ R|usage/implicitTypeFromAnotherModule|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
BODY_RESOLVE:
|
||||
FILE: [ResolvedTo(RAW_FIR)] dependency.kt
|
||||
public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): <implicit> { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] annotation.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitTypeFromAnotherModule(): R|kotlin/String| {
|
||||
^implicitTypeFromAnotherModule R|usage/implicitType|()
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] dependency.kt
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|kotlin/String| {
|
||||
^implicitType String(str)
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] usage.kt
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun usage(): R|kotlin/String| {
|
||||
^usage R|kotlin/run|<R|kotlin/String|>(<L> = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function0<R>] run@fun <anonymous>(): R|kotlin/String| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|usage/implicitType|()
|
||||
^ R|usage/implicitTypeFromAnotherModule|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
FILE RAW TO BODY:
|
||||
FILE: [ResolvedTo(BODY_RESOLVE)] usage.kt
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun usage(): R|kotlin/String| {
|
||||
^usage R|kotlin/run|<R|kotlin/String|>(<L> = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function0<R>] run@fun <anonymous>(): R|kotlin/String| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|usage/implicitType|()
|
||||
^ R|usage/implicitTypeFromAnotherModule|()
|
||||
}
|
||||
)
|
||||
}
|
||||
+6
@@ -945,6 +945,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst
|
||||
runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/hierarchyWithOverrideAndNestedClass3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitTypeFromFunctionWithDuplicatedName.kt")
|
||||
public void testImplicitTypeFromFunctionWithDuplicatedName() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/implicitTypeFromFunctionWithDuplicatedName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleLoopInOverride.kt")
|
||||
public void testSimpleLoopInOverride() throws Exception {
|
||||
|
||||
+6
@@ -945,6 +945,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou
|
||||
runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/hierarchyWithOverrideAndNestedClass3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitTypeFromFunctionWithDuplicatedName.kt")
|
||||
public void testImplicitTypeFromFunctionWithDuplicatedName() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/implicitTypeFromFunctionWithDuplicatedName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleLoopInOverride.kt")
|
||||
public void testSimpleLoopInOverride() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user