Files
kotlin-fork/idea/testData/refactoring/extractFunction/controlFlow/outputValues/genericPair.kt
T
Dmitriy Novozhilov b66bbdf7a6 [IDE-NI-MIGRATE] [BAD] Migrate testdata of Extraction tests
Bad tests:
- IntroduceTypeParameter.testDuplicates
- IntroduceTypeParameter.testNullableType
- IntroduceTypeParameter.testUserType
- IntroduceTypeParameter.testFunctionType
- IntroduceTypeParameter.testInClass
- ExtractFunction.TypeParameters.testNoVarianceInFun
- ExtractFunction.Parameters.CandidateTypes.testNonNullableTypes
- ExtractFunction.Parameters.CandidateTypes.testMultipleTypes
- ExtractFunction.ControlFlow.OutputValues.testGenericPair
- IntroduceVariable.ExplicateTypeArguments.testDeeperNestedCall
2019-05-06 11:36:28 +03:00

20 lines
500 B
Kotlin
Vendored

// COMPILER_ARGUMENTS: -XXLanguage:-NewInference
// WITH_RUNTIME
// PARAM_TYPES: A?, kotlin.Any?
// PARAM_TYPES: B, A
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: var a: A? defined in foo
// PARAM_DESCRIPTOR: value-parameter b: B defined in foo
// PARAM_DESCRIPTOR: var c: kotlin.Int defined in foo
// SIBLING:
fun <A: Any, B: A> foo(b: B): Int {
var a: A? = null
var c: Int = 1
<selection>a = b
c += 2
println(a)
println(c)</selection>
return a.hashCode() ?: 0 + c
}