[FIR] Unwrap vararg array types for diagnostic rendering
#KT-65770 Fixed
This commit is contained in:
committed by
Space Team
parent
eae72eac54
commit
33648e1f44
@@ -0,0 +1,5 @@
|
||||
/AmbiguousVararg.kt:7:5: error: overload resolution ambiguity:
|
||||
public fun foo(vararg t: String): String defined in root package in file AmbiguousVararg.kt
|
||||
public fun foo(vararg t: Int): String defined in root package in file AmbiguousVararg.kt
|
||||
foo()
|
||||
^^^
|
||||
@@ -0,0 +1 @@
|
||||
/AmbiguousVararg.kt:(128,131): error: Overload resolution ambiguity between candidates: [fun foo(vararg t: String): String, fun foo(vararg t: Int): String]
|
||||
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
fun foo(vararg t : String) = ""
|
||||
fun foo(vararg t : Int) = ""
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -5,13 +5,13 @@ build:
|
||||
[mkdir] Created dir: [Temp]/classes
|
||||
[javac] Compiling 2 source files to [Temp]/classes
|
||||
[javac] Compiling [[TestData]] => [[Temp]/classes]
|
||||
[javac] [TestData]/literals.kt:9:9: error: overload resolution ambiguity between candidates: [fun intArrayOf(vararg elements: IntArray): IntArray, fun intArrayOf(vararg elements: IntArray): IntArray]
|
||||
[javac] [TestData]/literals.kt:9:9: error: overload resolution ambiguity between candidates: [fun intArrayOf(vararg elements: Int): IntArray, fun intArrayOf(vararg elements: Int): IntArray]
|
||||
[javac] @AnnInt(intArrayOf(1, 2))
|
||||
[javac] ^^^^^^^^^^
|
||||
[javac] [TestData]/myArrayOf.kt:3:1: error: conflicting overloads: [fun intArrayOf(vararg elements: IntArray): IntArray]
|
||||
[javac] [TestData]/myArrayOf.kt:3:1: error: conflicting overloads: [fun intArrayOf(vararg elements: Int): IntArray]
|
||||
[javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO()
|
||||
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
[javac] [TestData]/myArrayOf.kt:4:1: error: conflicting overloads: [fun intArrayOf(vararg elements: IntArray): IntArray]
|
||||
[javac] [TestData]/myArrayOf.kt:4:1: error: conflicting overloads: [fun intArrayOf(vararg elements: Int): IntArray]
|
||||
[javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO()
|
||||
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -88,11 +88,11 @@ actual fun f16(s: String = "") {}
|
||||
^^^^^^^^^^^^^^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:28:12: error: 'actual fun f17(s: Array<out String>): Unit' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some value parameter is vararg in one declaration and non-vararg in the other:
|
||||
expect fun f17(vararg s: Array<out String>): Unit
|
||||
expect fun f17(vararg s: String): Unit
|
||||
|
||||
actual fun f17(s: Array<out String>) {}
|
||||
^^^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:29:12: error: 'actual fun f18(vararg s: Array<out String>): Unit' has no corresponding expected declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:29:12: error: 'actual fun f18(vararg s: String): Unit' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some value parameter is vararg in one declaration and non-vararg in the other:
|
||||
expect fun f18(s: Array<out String>): Unit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user