[LL/FIR] add tests on function parameter as implicit return type
^KT-64164
This commit is contained in:
committed by
Space Team
parent
145958e284
commit
3d43dff8b5
+6
@@ -1944,6 +1944,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionParameterAsImplicitReturnType.kt")
|
||||
public void testFunctionParameterAsImplicitReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/functionParameterAsImplicitReturnType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("illegalRequireKotlinValue.kt")
|
||||
public void testIllegalRequireKotlinValue() throws Exception {
|
||||
|
||||
+6
@@ -1950,6 +1950,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionParameterAsImplicitReturnType.kt")
|
||||
public void testFunctionParameterAsImplicitReturnType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/functionParameterAsImplicitReturnType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("illegalRequireKotlinValue.kt")
|
||||
public void testIllegalRequireKotlinValue() throws Exception {
|
||||
|
||||
+10
@@ -106,6 +106,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithAnnotations.kt")
|
||||
public void testConstructorWithAnnotations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithLocalDeclarations.kt")
|
||||
public void testConstructorWithLocalDeclarations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt");
|
||||
@@ -231,6 +236,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionWithAnnotations.kt")
|
||||
public void testFunctionWithAnnotations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionWithAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericFunctions.kt")
|
||||
public void testGenericFunctions() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/genericFunctions.kt");
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
@Anno(<strcat>(String(nested nested parameter type ), prop#))
|
||||
owner -> FirConstructorSymbol /A.A
|
||||
context -> FirValueParameterSymbol <local>/param from FirConstructorSymbol /A.A
|
||||
|
||||
@Anno(<strcat>(String(nested parameter type ), prop#))
|
||||
owner -> FirConstructorSymbol /A.A
|
||||
context -> FirValueParameterSymbol <local>/param from FirConstructorSymbol /A.A
|
||||
|
||||
@Anno(<strcat>(String(parameter type ), prop#))
|
||||
owner -> FirConstructorSymbol /A.A
|
||||
context -> FirValueParameterSymbol <local>/param from FirConstructorSymbol /A.A
|
||||
|
||||
@Anno(<strcat>(String(defaultValue ), prop#))
|
||||
owner -> FirConstructorSymbol /A.A
|
||||
context -> FirAnonymousFunctionSymbol special/anonymous from FirValueParameterSymbol <local>/param from FirConstructorSymbol /A.A
|
||||
|
||||
@Anno(<strcat>(String(anonymousFunction return type ), prop#))
|
||||
owner -> FirConstructorSymbol /A.A
|
||||
context -> FirAnonymousFunctionSymbol special/anonymous from FirValueParameterSymbol <local>/param from FirConstructorSymbol /A.A
|
||||
|
||||
@Anno(<strcat>(String(anonymousFunction parameter type ), prop#))
|
||||
owner -> FirConstructorSymbol /A.A
|
||||
context -> FirValueParameterSymbol <local>/i from FirAnonymousFunctionSymbol special/anonymous from FirValueParameterSymbol <local>/param from FirConstructorSymbol /A.A
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
constructor(param: @Anno("parameter type $prop") List<@Anno("nested parameter type $prop") Collection<@Anno("nested nested parameter type $prop") String>> = @Anno("defaultValue $prop") fun(i: @Anno("anonymousFunction parameter type $prop") Int): @Anno("anonymousFunction return type $prop") Int {})
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
FILE: constructorWithAnnotations.kt
|
||||
public? final? class A : R|kotlin/Any| {
|
||||
public? constructor(param: @Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) Collection<@Anno(LAZY_EXPRESSION) String>> = LAZY_EXPRESSION): R|A| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
FILE: constructorWithAnnotations.kt
|
||||
public? final? class A : R|kotlin/Any| {
|
||||
public? [ContainingClassKey=A] constructor(param: @Anno(<strcat>(String(parameter type ), prop#)) List<@Anno(<strcat>(String(nested parameter type ), prop#)) Collection<@Anno(<strcat>(String(nested nested parameter type ), prop#)) String>> = @Anno(<strcat>(String(defaultValue ), prop#)) fun <anonymous>(i: @Anno(<strcat>(String(anonymousFunction parameter type ), prop#)) Int): @Anno(<strcat>(String(anonymousFunction return type ), prop#)) Int <inline=Unknown> {
|
||||
}
|
||||
): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
@NestedNestedParameterTypeAnnotation(<strcat>(String(nested nested ), prop#))
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
|
||||
@NestedParameterTypeAnnotation(<strcat>(String(nested ), prop#))
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
|
||||
@ParameterTypeAnnotation(<strcat>(prop#))
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
|
||||
@ParameterAnnotation(String(param))
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
|
||||
@DefaultValueAnnotation()
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirAnonymousFunctionSymbol special/anonymous from FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
|
||||
@Anno(<strcat>(String(anonymousFunction return type ), prop#))
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirAnonymousFunctionSymbol special/anonymous from FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
|
||||
@Anno(<strcat>(String(anonymousFunction parameter type ), prop#))
|
||||
owner -> FirNamedFunctionSymbol /foo
|
||||
context -> FirValueParameterSymbol <local>/i from FirAnonymousFunctionSymbol special/anonymous from FirValueParameterSymbol <local>/param1 from FirNamedFunctionSymbol /foo
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(@ParameterAnnotation("param") param1: @ParameterTypeAnnotation("$prop") List<@NestedParameterTypeAnnotation("nested $prop") Collection<@NestedNestedParameterTypeAnnotation("nested nested $prop") String>> = @DefaultValueAnnotation fun(i: @Anno("anonymousFunction parameter type $prop") Int): @Anno("anonymousFunction return type $prop") Int {}) = param1
|
||||
compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionWithAnnotations.lazyBodies.txt
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
FILE: functionWithAnnotations.kt
|
||||
public? final? fun foo(@ParameterAnnotation(LAZY_EXPRESSION) param1: @ParameterTypeAnnotation(LAZY_EXPRESSION) List<@NestedParameterTypeAnnotation(LAZY_EXPRESSION) Collection<@NestedNestedParameterTypeAnnotation(LAZY_EXPRESSION) String>> = LAZY_EXPRESSION): <implicit> { LAZY_BLOCK }
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
FILE: functionWithAnnotations.kt
|
||||
public? final? fun foo(@ParameterAnnotation(String(param)) param1: @ParameterTypeAnnotation(<strcat>(prop#)) List<@NestedParameterTypeAnnotation(<strcat>(String(nested ), prop#)) Collection<@NestedNestedParameterTypeAnnotation(<strcat>(String(nested nested ), prop#)) String>> = @DefaultValueAnnotation() fun <anonymous>(i: @Anno(<strcat>(String(anonymousFunction parameter type ), prop#)) Int): @Anno(<strcat>(String(anonymousFunction return type ), prop#)) Int <inline=Unknown> {
|
||||
}
|
||||
): <implicit> {
|
||||
^foo param1#
|
||||
}
|
||||
+10
@@ -106,6 +106,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithAnnotations.kt")
|
||||
public void testConstructorWithAnnotations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithLocalDeclarations.kt")
|
||||
public void testConstructorWithLocalDeclarations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt");
|
||||
@@ -231,6 +236,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionWithAnnotations.kt")
|
||||
public void testFunctionWithAnnotations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionWithAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericFunctions.kt")
|
||||
public void testGenericFunctions() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/genericFunctions.kt");
|
||||
|
||||
+10
@@ -106,6 +106,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithAnnotations.kt")
|
||||
public void testConstructorWithAnnotations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithLocalDeclarations.kt")
|
||||
public void testConstructorWithLocalDeclarations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt");
|
||||
@@ -231,6 +236,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionWithAnnotations.kt")
|
||||
public void testFunctionWithAnnotations() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionWithAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericFunctions.kt")
|
||||
public void testGenericFunctions() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/genericFunctions.kt");
|
||||
|
||||
Reference in New Issue
Block a user