AA: regression test for default value that calls previous params
This commit is contained in:
committed by
Ilya Kirillov
parent
6e6659fc2a
commit
384ed9cc9e
+6
@@ -346,6 +346,12 @@ public class Fe10IdeNormalAnalysisSourceModuleResolveCallTestGenerated extends A
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueThatCallsPreviousParameter.kt")
|
||||
public void testDefaultValueThatCallsPreviousParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/defaultValueThatCallsPreviousParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatedConstructorCall_super.kt")
|
||||
public void testDelegatedConstructorCall_super() throws Exception {
|
||||
|
||||
+6
@@ -346,6 +346,12 @@ public class FirIdeNormalAnalysisSourceModuleResolveCallTestGenerated extends Ab
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueThatCallsPreviousParameter.kt")
|
||||
public void testDefaultValueThatCallsPreviousParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/defaultValueThatCallsPreviousParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatedConstructorCall_super.kt")
|
||||
public void testDelegatedConstructorCall_super() throws Exception {
|
||||
|
||||
+6
@@ -346,6 +346,12 @@ public class FirStandaloneNormalAnalysisSourceModuleResolveCallTestGenerated ext
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueThatCallsPreviousParameter.kt")
|
||||
public void testDefaultValueThatCallsPreviousParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/defaultValueThatCallsPreviousParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatedConstructorCall_super.kt")
|
||||
public void testDelegatedConstructorCall_super() throws Exception {
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// Lint regression test from https://issuetracker.google.com/127955232
|
||||
|
||||
// FILE: call.kt
|
||||
|
||||
package com.example.myapplication
|
||||
|
||||
import test.pkg.Context
|
||||
import test.pkg.R
|
||||
|
||||
data class Test(
|
||||
val context: Context,
|
||||
val testInt: Int,
|
||||
val testString: String = context.<expr>getString</expr>(if (testInt == 0) R.string.test_string_1 else R.string.test_string_2))
|
||||
)
|
||||
|
||||
// FILE: Context.java
|
||||
|
||||
package test.pkg;
|
||||
|
||||
public final class Context {
|
||||
public String getString(int id) {
|
||||
if (id == R.string.test_string_1) return "id1"
|
||||
if (id == R.string.test_string_2) return "id2"
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: R.java
|
||||
|
||||
package test.pkg;
|
||||
|
||||
public final class R {
|
||||
public static final class string {
|
||||
public static final int test_string_1 = 0x7f0a000e;
|
||||
public static final int test_string_2 = 0x7f020057;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = context
|
||||
isSafeNavigation = false
|
||||
type = test.pkg.Context
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String!
|
||||
symbol = test/pkg/Context.getString(<dispatch receiver>: test.pkg.Context, id: kotlin.Int): kotlin.String!
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = id
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = id: kotlin.Int
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = test/pkg/Context.getString
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
if (testInt == 0) R.string.test_string_1 else R.string.test_string_2 -> (KtVariableLikeSignature:
|
||||
name = id
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = id: kotlin.Int
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
Reference in New Issue
Block a user