Add test that calls a local function multiple times

This commit is contained in:
Tamas Vajk
2022-03-09 09:15:22 +01:00
committed by Ian Lynagh
parent ea74803053
commit 9597932112
4 changed files with 56 additions and 30 deletions

View File

@@ -0,0 +1,4 @@
[INVALID_KEY_SET] predicate isAnonymClass(@class classid, @classinstancexpr parent): The key set {classid} does not functionally determine all fields.
Here is a pair of tuples that agree on the key set but differ at index 1:
Tuple 1 in row 28: (3797,3825)
Tuple 2 in row 29: (3797,3842)

View File

@@ -2337,12 +2337,23 @@ localFunctionCalls.kt:
# 10| -3: [TypeAccess] C1<Integer>
# 10| 0: [TypeAccess] Integer
# 10| 1: [IntegerLiteral] 42
# 13| 2: [Class,GenericType,ParameterizedType] C1
# 11| 7: [ExprStmt] <Expr>;
# 11| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 11| 0: [TypeAccess] Unit
# 11| 1: [MethodAccess] f1(...)
# 11| -2: [TypeAccess] Integer
# 11| -1: [ClassInstanceExpr] new (...)
# 11| -3: [TypeAccess] Object
# 11| 0: [ClassInstanceExpr] new C1<Integer>(...)
# 11| -3: [TypeAccess] C1<Integer>
# 11| 0: [TypeAccess] Integer
# 11| 1: [IntegerLiteral] 42
# 14| 2: [Class,GenericType,ParameterizedType] C1
#-----| -2: (Generic Parameters)
# 13| 0: [TypeVariable] T
# 13| 1: [Constructor] C1
# 13| 5: [BlockStmt] { ... }
# 13| 0: [SuperConstructorInvocationStmt] super(...)
# 14| 0: [TypeVariable] T
# 14| 1: [Constructor] C1
# 14| 5: [BlockStmt] { ... }
# 14| 0: [SuperConstructorInvocationStmt] super(...)
samConversion.kt:
# 0| [CompilationUnit] samConversion
# 0| 1: [Class] SamConversionKt

View File

@@ -1395,35 +1395,45 @@
| funcExprs.kt:69:12:69:22 | Integer | funcExprs.kt:68:5:70:5 | call | TypeAccess |
| funcExprs.kt:69:12:69:22 | String | funcExprs.kt:68:5:70:5 | call | TypeAccess |
| funcExprs.kt:69:20:69:20 | a | funcExprs.kt:69:12:69:22 | invoke | StringLiteral |
| localFunctionCalls.kt:4:5:4:13 | x | localFunctionCalls.kt:3:1:11:1 | x | LocalVariableDeclExpr |
| localFunctionCalls.kt:4:13:4:13 | 5 | localFunctionCalls.kt:3:1:11:1 | x | IntegerLiteral |
| localFunctionCalls.kt:4:5:4:13 | x | localFunctionCalls.kt:3:1:12:1 | x | LocalVariableDeclExpr |
| localFunctionCalls.kt:4:13:4:13 | 5 | localFunctionCalls.kt:3:1:12:1 | x | IntegerLiteral |
| localFunctionCalls.kt:5:25:5:25 | i | localFunctionCalls.kt:5:5:5:29 | a | VarAccess |
| localFunctionCalls.kt:5:25:5:29 | ... + ... | localFunctionCalls.kt:5:5:5:29 | a | AddExpr |
| localFunctionCalls.kt:5:29:5:29 | x | localFunctionCalls.kt:5:5:5:29 | a | VarAccess |
| localFunctionCalls.kt:6:5:6:5 | x | localFunctionCalls.kt:3:1:11:1 | x | VarAccess |
| localFunctionCalls.kt:6:5:6:9 | ...=... | localFunctionCalls.kt:3:1:11:1 | x | AssignExpr |
| localFunctionCalls.kt:6:9:6:9 | 6 | localFunctionCalls.kt:3:1:11:1 | x | IntegerLiteral |
| localFunctionCalls.kt:7:5:7:17 | <implicit coercion to unit> | localFunctionCalls.kt:3:1:11:1 | x | ImplicitCoercionToUnitExpr |
| localFunctionCalls.kt:7:5:7:17 | Object | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:7:5:7:17 | String | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:7:5:7:17 | Unit | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:7:5:7:17 | a(...) | localFunctionCalls.kt:3:1:11:1 | x | MethodAccess |
| localFunctionCalls.kt:7:5:7:17 | new (...) | localFunctionCalls.kt:3:1:11:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:7:15:7:16 | 42 | localFunctionCalls.kt:3:1:11:1 | x | IntegerLiteral |
| localFunctionCalls.kt:8:5:8:5 | x | localFunctionCalls.kt:3:1:11:1 | x | VarAccess |
| localFunctionCalls.kt:8:5:8:9 | ...=... | localFunctionCalls.kt:3:1:11:1 | x | AssignExpr |
| localFunctionCalls.kt:8:9:8:9 | 7 | localFunctionCalls.kt:3:1:11:1 | x | IntegerLiteral |
| localFunctionCalls.kt:6:5:6:5 | x | localFunctionCalls.kt:3:1:12:1 | x | VarAccess |
| localFunctionCalls.kt:6:5:6:9 | ...=... | localFunctionCalls.kt:3:1:12:1 | x | AssignExpr |
| localFunctionCalls.kt:6:9:6:9 | 6 | localFunctionCalls.kt:3:1:12:1 | x | IntegerLiteral |
| localFunctionCalls.kt:7:5:7:17 | <implicit coercion to unit> | localFunctionCalls.kt:3:1:12:1 | x | ImplicitCoercionToUnitExpr |
| localFunctionCalls.kt:7:5:7:17 | Object | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:7:5:7:17 | String | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:7:5:7:17 | Unit | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:7:5:7:17 | a(...) | localFunctionCalls.kt:3:1:12:1 | x | MethodAccess |
| localFunctionCalls.kt:7:5:7:17 | new (...) | localFunctionCalls.kt:3:1:12:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:7:15:7:16 | 42 | localFunctionCalls.kt:3:1:12:1 | x | IntegerLiteral |
| localFunctionCalls.kt:8:5:8:5 | x | localFunctionCalls.kt:3:1:12:1 | x | VarAccess |
| localFunctionCalls.kt:8:5:8:9 | ...=... | localFunctionCalls.kt:3:1:12:1 | x | AssignExpr |
| localFunctionCalls.kt:8:9:8:9 | 7 | localFunctionCalls.kt:3:1:12:1 | x | IntegerLiteral |
| localFunctionCalls.kt:9:34:9:34 | 5 | localFunctionCalls.kt:9:5:9:34 | f1 | IntegerLiteral |
| localFunctionCalls.kt:10:5:10:13 | C1<Integer> | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:10:5:10:13 | Integer | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:10:5:10:13 | new C1<Integer>(...) | localFunctionCalls.kt:3:1:11:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:10:15:10:20 | <implicit coercion to unit> | localFunctionCalls.kt:3:1:11:1 | x | ImplicitCoercionToUnitExpr |
| localFunctionCalls.kt:10:15:10:20 | Integer | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:10:15:10:20 | Object | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:10:15:10:20 | Unit | localFunctionCalls.kt:3:1:11:1 | x | TypeAccess |
| localFunctionCalls.kt:10:15:10:20 | f1(...) | localFunctionCalls.kt:3:1:11:1 | x | MethodAccess |
| localFunctionCalls.kt:10:15:10:20 | new (...) | localFunctionCalls.kt:3:1:11:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:10:18:10:19 | 42 | localFunctionCalls.kt:3:1:11:1 | x | IntegerLiteral |
| localFunctionCalls.kt:10:5:10:13 | C1<Integer> | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:10:5:10:13 | Integer | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:10:5:10:13 | new C1<Integer>(...) | localFunctionCalls.kt:3:1:12:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:10:15:10:20 | <implicit coercion to unit> | localFunctionCalls.kt:3:1:12:1 | x | ImplicitCoercionToUnitExpr |
| localFunctionCalls.kt:10:15:10:20 | Integer | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:10:15:10:20 | Object | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:10:15:10:20 | Unit | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:10:15:10:20 | f1(...) | localFunctionCalls.kt:3:1:12:1 | x | MethodAccess |
| localFunctionCalls.kt:10:15:10:20 | new (...) | localFunctionCalls.kt:3:1:12:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:10:18:10:19 | 42 | localFunctionCalls.kt:3:1:12:1 | x | IntegerLiteral |
| localFunctionCalls.kt:11:5:11:13 | C1<Integer> | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:11:5:11:13 | Integer | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:11:5:11:13 | new C1<Integer>(...) | localFunctionCalls.kt:3:1:12:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:11:15:11:20 | <implicit coercion to unit> | localFunctionCalls.kt:3:1:12:1 | x | ImplicitCoercionToUnitExpr |
| localFunctionCalls.kt:11:15:11:20 | Integer | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:11:15:11:20 | Object | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:11:15:11:20 | Unit | localFunctionCalls.kt:3:1:12:1 | x | TypeAccess |
| localFunctionCalls.kt:11:15:11:20 | f1(...) | localFunctionCalls.kt:3:1:12:1 | x | MethodAccess |
| localFunctionCalls.kt:11:15:11:20 | new (...) | localFunctionCalls.kt:3:1:12:1 | x | ClassInstanceExpr |
| localFunctionCalls.kt:11:18:11:19 | 42 | localFunctionCalls.kt:3:1:12:1 | x | IntegerLiteral |
| samConversion.kt:2:5:2:45 | isEven | samConversion.kt:1:1:14:1 | main | LocalVariableDeclExpr |
| samConversion.kt:2:18:2:45 | (...)... | samConversion.kt:1:1:14:1 | main | CastExpr |
| samConversion.kt:2:18:2:45 | ...=... | samConversion.kt:2:18:2:45 | | AssignExpr |

View File

@@ -8,6 +8,7 @@ fun x() {
x = 7
fun <T1> C1<T1>.f1(i: Int) = 5
C1<Int>().f1(42)
C1<Int>().f1(42)
}
class C1<T> {}