[Tests] Check for duplicate file names in FIR diagnostic tests with IR
The relative path of a test file is just its name, even if it's in a module. Diagnostics in IR are mapped to the file path and so it's reported on all files with the same path, i.e. name. This doesn't happen in production code because no two files can have the same path. The proper fix would be to prefix the test files' paths with the module name. Unfortunately, this breaks a bunch of test runners that rely on the current behavior. Especially, some JS runners turned out to be hard to fix. The linked YouTrack issue contains a WIP, incomplete patch of fixing some runners. #KT-61592 Fixed #KT-63252
This commit is contained in:
committed by
Space Team
parent
159d89b7af
commit
eba1fdec1d
@@ -11,10 +11,10 @@
|
||||
// MODULE: commonJS()()(common)
|
||||
// TARGET_PLATFORM: JS
|
||||
|
||||
// FILE: StringValue.kt
|
||||
actual class Strin<!NO_ACTUAL_FOR_EXPECT{JS}!>gValue(val value: String<!>)
|
||||
<!NO_ACTUAL_FOR_EXPECT{JS}!>
|
||||
actual fun StringValue.plus(other: String) = StringVal<!>ue(this.value + other)
|
||||
// FILE: StringValueJs.kt
|
||||
actual class StringValue(val value: String)
|
||||
|
||||
actual fun StringValue.plus(other: String) = StringValue(this.value + other)
|
||||
|
||||
// MODULE: intermediate()()(common)
|
||||
// TARGET_PLATFORM: Common
|
||||
@@ -31,10 +31,10 @@ interface KotlinXStringDemoInterface {
|
||||
// MODULE: js()()(common, intermediate)
|
||||
// TARGET_PLATFORM: JS
|
||||
|
||||
// FILE: StringDemoInterface.kt
|
||||
// FILE: StringDemoInterfaceJs.kt
|
||||
actual typealias StringDemoInterface = KotlinXStringDemoInterface
|
||||
|
||||
actual fun StringDemoIn<!EXPECT_ACTUAL_INCOMPATIBILITY!>terface.<!ACTUAL_WITHOUT_EXPECT("actual fun StringDemoInterface.plusK(): <ERROR TYPE REF: Unresolved name: value>; The following declaration is incompatible because return type is different: expect fun StringDemoInterface.plusK(): String")!>plusK<!>() = <!EXPECT_CLASS_AS_FUNCTION!>StringValue<!>(value).plus("K")<!>.<!UNRESOLVED_REFERENCE!>value<!>
|
||||
actual fun StringDemoInterface.<!ACTUAL_WITHOUT_EXPECT("actual fun StringDemoInterface.plusK(): <ERROR TYPE REF: Unresolved name: value>; The following declaration is incompatible because return type is different: expect fun StringDemoInterface.plusK(): String")!>plusK<!>() = <!EXPECT_CLASS_AS_FUNCTION!>StringValue<!>(value).plus("K").<!UNRESOLVED_REFERENCE!>value<!>
|
||||
|
||||
// FILE: main.kt
|
||||
class StringDemo(override val value: String) : StringDemoInterface
|
||||
|
||||
@@ -11,7 +11,7 @@ expect fun StringValue.<!NO_ACTUAL_FOR_EXPECT{JS}!>plus<!>(other: String): Strin
|
||||
// MODULE: commonJS()()(common)
|
||||
// TARGET_PLATFORM: JS
|
||||
|
||||
// FILE: StringValue.kt
|
||||
// FILE: StringValueJs.kt
|
||||
actual class StringValue(val value: String)
|
||||
|
||||
actual fun StringValue.plus(other: String) = StringValue(this.value + other)
|
||||
@@ -31,7 +31,7 @@ expect fun StringDemoInterface.plusK(): <!NO_ACTUAL_FOR_EXPECT{JS}!>String<!>
|
||||
// MODULE: js()()(common, intermediate)
|
||||
// TARGET_PLATFORM: JS
|
||||
|
||||
// FILE: StringDemoInterface.kt
|
||||
// FILE: StringDemoInterfaceJs.kt
|
||||
actual typealias StringDemoInterface = KotlinXStringDemoInterface
|
||||
|
||||
actual fun StringDemoInterface.<!ACTUAL_WITHOUT_EXPECT("Actual function 'plusK'; The following declaration is incompatible because return type is different: public expect fun StringDemoInterface /* = KotlinXStringDemoInterface */.plusK(): String")!>plusK<!>() = <!RESOLUTION_TO_CLASSIFIER!>StringValue<!>(value).<!DEBUG_INFO_MISSING_UNRESOLVED!>plus<!>("K").<!DEBUG_INFO_MISSING_UNRESOLVED!>value<!>
|
||||
|
||||
Reference in New Issue
Block a user