From 3c865bdddd627b3947d1d17d29c7ae7327f8afed Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Wed, 20 Sep 2023 13:47:22 +0200 Subject: [PATCH] [LL FIR] add lazy resolve tests on function with raw contract and implicit type ^KT-56551 --- .../implicitTypeOnFunctionWithRawContract.kt | 6 + ...nctionWithRawContract.out_of_src_roots.txt | 117 ++++++++++++++++ .../implicitTypeOnFunctionWithRawContract.txt | 126 ++++++++++++++++++ ...TypeOnFunctionWithUnresolvedRawContract.kt | 5 + ...ypeOnFunctionWithUnresolvedRawContract.txt | 117 ++++++++++++++++ ...licitTypeOnFunctionWithWrongRawContract.kt | 6 + ...nWithWrongRawContract.out_of_src_roots.txt | 117 ++++++++++++++++ ...icitTypeOnFunctionWithWrongRawContract.txt | 121 +++++++++++++++++ ...otLazyDeclarationResolveTestGenerated.java | 18 +++ ...ceLazyDeclarationResolveTestGenerated.java | 18 +++ 10 files changed, 651 insertions(+) create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.txt diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.kt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.kt new file mode 100644 index 00000000000..ff2458d94a5 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.kt @@ -0,0 +1,6 @@ +// LANGUAGE: +ContractSyntaxV2 +import kotlin.contracts.* + +fun foo(bool: Boolean) contract [ + returns() implies bool +] = bool diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt new file mode 100644 index 00000000000..c2a4e4a2f68 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt @@ -0,0 +1,117 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] fun foo([ResolvedTo(COMPANION_GENERATION)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(SUPER_TYPES)] fun foo([ResolvedTo(SUPER_TYPES)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(TYPES)] fun foo([ResolvedTo(TYPES)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] fun foo([ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(CONTRACTS)] fun foo([ResolvedTo(CONTRACTS)] bool: R|kotlin/Boolean|): { + ^foo bool# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.txt new file mode 100644 index 00000000000..dc81183b09c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.txt @@ -0,0 +1,126 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] fun foo([ResolvedTo(COMPANION_GENERATION)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(SUPER_TYPES)] fun foo([ResolvedTo(SUPER_TYPES)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public? final? [ResolvedTo(TYPES)] fun foo([ResolvedTo(TYPES)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] fun foo([ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(CONTRACTS)] fun foo([ResolvedTo(CONTRACTS)] bool: R|kotlin/Boolean|): + [R|Contract description] + < + Returns(WILDCARD) -> bool + > + { + ^foo bool# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + Returns(WILDCARD) -> bool + > + { + ^foo R|/bool| + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + Returns(WILDCARD) -> bool + > + { + ^foo R|/bool| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + Returns(WILDCARD) -> bool + > + { + ^foo R|/bool| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeOnFunctionWithRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + Returns(WILDCARD) -> bool + > + { + ^foo R|/bool| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.kt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.kt new file mode 100644 index 00000000000..fbe4504750b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.kt @@ -0,0 +1,5 @@ +// LANGUAGE: +ContractSyntaxV2 + +fun foo(bool: Boolean) contract [ + returns() implies bool +] = bool diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt new file mode 100644 index 00000000000..684576e056c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt @@ -0,0 +1,117 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] fun foo([ResolvedTo(COMPANION_GENERATION)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public? final? [ResolvedTo(SUPER_TYPES)] fun foo([ResolvedTo(SUPER_TYPES)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public? final? [ResolvedTo(TYPES)] fun foo([ResolvedTo(TYPES)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] fun foo([ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(CONTRACTS)] fun foo([ResolvedTo(CONTRACTS)] bool: R|kotlin/Boolean|): { + ^foo bool# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeOnFunctionWithUnresolvedRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + #().#(R|/bool|) + > + { + ^foo R|/bool| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt new file mode 100644 index 00000000000..e6bf22a7fa1 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt @@ -0,0 +1,6 @@ +// LANGUAGE: +ContractSyntaxV2 +import kotlin.contracts.* + +fun foo(bool: Boolean) contract [ + abc +] = bool diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt new file mode 100644 index 00000000000..b885c703ebb --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt @@ -0,0 +1,117 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] fun foo([ResolvedTo(COMPANION_GENERATION)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(SUPER_TYPES)] fun foo([ResolvedTo(SUPER_TYPES)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(TYPES)] fun foo([ResolvedTo(TYPES)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] fun foo([ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(CONTRACTS)] fun foo([ResolvedTo(CONTRACTS)] bool: R|kotlin/Boolean|): { + ^foo bool# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + # + > + { + ^foo R|/bool| + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + # + > + { + ^foo R|/bool| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + # + > + { + ^foo R|/bool| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [Contract description] < + # + > + { + ^foo R|/bool| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.txt new file mode 100644 index 00000000000..2a41a12620b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.txt @@ -0,0 +1,121 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] fun foo([ResolvedTo(COMPANION_GENERATION)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(SUPER_TYPES)] fun foo([ResolvedTo(SUPER_TYPES)] bool: Boolean): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public? final? [ResolvedTo(TYPES)] fun foo([ResolvedTo(TYPES)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] fun foo([ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] bool: R|kotlin/Boolean|): + [Contract description] < + LAZY_EXPRESSION + > + { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(CONTRACTS)] fun foo([ResolvedTo(CONTRACTS)] bool: R|kotlin/Boolean|): + [R|Contract description] + < + > + { + ^foo bool# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + > + { + ^foo R|/bool| + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + > + { + ^foo R|/bool| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + > + { + ^foo R|/bool| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeOnFunctionWithWrongRawContract.kt + public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| + [R|Contract description] + < + > + { + ^foo R|/bool| + } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java index b9ddb494aa4..416ee6b6502 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java @@ -276,6 +276,24 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/functionWithParameter.kt"); } + @Test + @TestMetadata("implicitTypeOnFunctionWithRawContract.kt") + public void testImplicitTypeOnFunctionWithRawContract() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.kt"); + } + + @Test + @TestMetadata("implicitTypeOnFunctionWithUnresolvedRawContract.kt") + public void testImplicitTypeOnFunctionWithUnresolvedRawContract() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.kt"); + } + + @Test + @TestMetadata("implicitTypeOnFunctionWithWrongRawContract.kt") + public void testImplicitTypeOnFunctionWithWrongRawContract() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt"); + } + @Test @TestMetadata("lambdaAsSAMInterface.kt") public void testLambdaAsSAMInterface() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java index 37788003e3b..5ca0d5d52ae 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java @@ -276,6 +276,24 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/functionWithParameter.kt"); } + @Test + @TestMetadata("implicitTypeOnFunctionWithRawContract.kt") + public void testImplicitTypeOnFunctionWithRawContract() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.kt"); + } + + @Test + @TestMetadata("implicitTypeOnFunctionWithUnresolvedRawContract.kt") + public void testImplicitTypeOnFunctionWithUnresolvedRawContract() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.kt"); + } + + @Test + @TestMetadata("implicitTypeOnFunctionWithWrongRawContract.kt") + public void testImplicitTypeOnFunctionWithWrongRawContract() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt"); + } + @Test @TestMetadata("lambdaAsSAMInterface.kt") public void testLambdaAsSAMInterface() throws Exception {