Do not check argumentMapping.isError()

Argument matching status can be considered an "error" in resolve,
even though it is not a compilation error and doesn't prevent code
from being generated.
Actually, we should only check if the argument matching status is
ArgumentMatch.

 #KT-18294 Fixed
This commit is contained in:
Dmitry Petrov
2017-06-05 16:43:26 +03:00
parent e2aa3518df
commit fd1866b838
4 changed files with 36 additions and 4 deletions
@@ -0,0 +1,9 @@
fun <R : Number> Number.convert(): R = TODO()
fun foo(arg: Number) {
}
fun main(args: Array<String>) {
val x: Int = 0
foo(x.convert())
}
@@ -0,0 +1,19 @@
FILE /argumentMappedWithError.kt
FUN public fun <R : kotlin.Number> kotlin.Number.convert(): R
TYPE_PARAMETER <R : kotlin.Number>
$receiver: VALUE_PARAMETER this@convert: Number
BLOCK_BODY
RETURN type=kotlin.Nothing from='convert() on Number: R'
CALL 'TODO(): Nothing' type=kotlin.Nothing origin=null
FUN public fun foo(arg: kotlin.Number): kotlin.Unit
VALUE_PARAMETER value-parameter arg: kotlin.Number
BLOCK_BODY
FUN public fun main(args: kotlin.Array<kotlin.String>): kotlin.Unit
VALUE_PARAMETER value-parameter args: kotlin.Array<kotlin.String>
BLOCK_BODY
VAR val x: kotlin.Int = 0
CONST Int type=kotlin.Int value='0'
CALL 'foo(Number): Unit' type=kotlin.Unit origin=null
arg: CALL 'convert() on Number: Number' type=kotlin.Number origin=null
<R : Number>: Number
$receiver: GET_VAR 'x: Int' type=kotlin.Int origin=null