// LANGUAGE: +ExpectRefinement
// IGNORE_FIR_DIAGNOSTICS
// WITH_STDLIB
// RUN_PIPELINE_TILL: BACKEND
// MODULE: common
<!CONFLICTING_OVERLOADS{JVM;JVM;JVM}!>expect fun foo()<!>
expect class <!PACKAGE_OR_CLASSIFIER_REDECLARATION{JVM;JVM;JVM}!>Foo<!>

// MODULE: intermediate1()()(common)
<!CONFLICTING_OVERLOADS, CONFLICTING_OVERLOADS{JVM;JVM}!><!OPT_IN_WITHOUT_ARGUMENTS, OPT_IN_WITHOUT_ARGUMENTS{JVM}!>@OptIn(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, ANNOTATION_ARGUMENT_MUST_BE_CONST{JVM}!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE{JVM}!>ExperimentalMultiplatform<!>::class<!>)<!>
<!WRONG_ANNOTATION_TARGET{JVM}!>@kotlin.<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE{JVM}!>experimental<!>.<!DEBUG_INFO_MISSING_UNRESOLVED, DEBUG_INFO_MISSING_UNRESOLVED{JVM}!>ExpectRefinement<!><!>
expect fun foo()<!>
<!OPT_IN_WITHOUT_ARGUMENTS, OPT_IN_WITHOUT_ARGUMENTS{JVM}!>@OptIn(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, ANNOTATION_ARGUMENT_MUST_BE_CONST{JVM}!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE{JVM}!>ExperimentalMultiplatform<!>::class<!>)<!>
@kotlin.<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE{JVM}!>experimental<!>.<!DEBUG_INFO_MISSING_UNRESOLVED, DEBUG_INFO_MISSING_UNRESOLVED{JVM}!>ExpectRefinement<!>
expect class <!PACKAGE_OR_CLASSIFIER_REDECLARATION, PACKAGE_OR_CLASSIFIER_REDECLARATION{JVM;JVM}!>Foo<!>

// MODULE: intermediate2()()(intermediate1)
<!CONFLICTING_OVERLOADS, CONFLICTING_OVERLOADS{JVM}!><!OPT_IN_WITHOUT_ARGUMENTS!>@OptIn(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>ExperimentalMultiplatform<!>::class<!>)<!>
<!WRONG_ANNOTATION_TARGET{JVM}!>@kotlin.<!UNRESOLVED_REFERENCE!>experimental<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>ExpectRefinement<!><!>
expect fun foo()<!>
<!OPT_IN_WITHOUT_ARGUMENTS!>@OptIn(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>ExperimentalMultiplatform<!>::class<!>)<!>
@kotlin.<!UNRESOLVED_REFERENCE!>experimental<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>ExpectRefinement<!>
expect class <!PACKAGE_OR_CLASSIFIER_REDECLARATION, PACKAGE_OR_CLASSIFIER_REDECLARATION{JVM}!>Foo<!>

// MODULE: main()()(intermediate2)
actual fun <!AMBIGUOUS_EXPECTS!>foo<!>() {}
actual class <!AMBIGUOUS_EXPECTS, PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo<!>

/* GENERATED_FIR_TAGS: actual, classDeclaration, classReference, expect, functionDeclaration */
