Skip to content

Commit 31867a5

Browse files
committed
Kotlin: Accept test changes
Accept test changes from Kotlin 2.3.0 update Updates expected test outputs for kotlin2 library tests to match actual compiler output. Changes include: - Location adjustments for properties/methods (now point to identifiers) - CastExpr -> ImplicitCastExpr for implicit type casts - Removed duplicate BlockStmt entries in loop ASTs - Super constructor call location changes Note that in Kotlin 2.3.0 super constructor calls now have locations spanning entire class declarations instead of the actual super call site.
1 parent 86d9c34 commit 31867a5

File tree

40 files changed

+902
-941
lines changed

40 files changed

+902
-941
lines changed

java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_8_0/IrSimpleTypeImplCompat.kt

Lines changed: 0 additions & 19 deletions
This file was deleted.

java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_3_0-Beta2/IrSimpleTypeImplCompat.kt

Lines changed: 0 additions & 21 deletions
This file was deleted.

java/ql/test-kotlin2/library-tests/annotation_classes/PrintAst.expected

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Annot1j.java:
2222
def.kt:
2323
# 0| [CompilationUnit] def
2424
# 0| 1: [Class] DefKt
25-
# 45| 2: [Method] fn
25+
# 46| 2: [Method] fn
2626
#-----| 1: (Annotations)
2727
# 45| 1: [Annotation] Annot0k
2828
# 21| 1: [IntegerLiteral] 0
2929
#-----| 2: (Generic Parameters)
3030
# 46| 0: [TypeVariable] T
31-
# 45| 3: [TypeAccess] Unit
31+
# 46| 3: [TypeAccess] Unit
3232
#-----| 4: (Parameters)
3333
# 46| 0: [Parameter] a
3434
#-----| -1: (Annotations)
@@ -41,38 +41,38 @@ def.kt:
4141
# 47| -1: [TypeAccess] ConsoleKt
4242
# 47| 0: [MethodCall] a(...)
4343
# 47| -1: [VarAccess] a
44-
# 49| 1: [LocalVariableDeclStmt] var ...;
45-
# 49| 1: [LocalVariableDeclExpr] x
44+
# 50| 1: [LocalVariableDeclStmt] var ...;
45+
# 50| 1: [LocalVariableDeclExpr] x
4646
# 50| 0: [IntegerLiteral] 10
47-
# 53| 3: [Method] getP
47+
# 57| 3: [Method] getP
4848
#-----| 1: (Annotations)
4949
# 54| 1: [Annotation] Annot0k
5050
# 21| 1: [IntegerLiteral] 0
51-
# 53| 3: [TypeAccess] int
52-
# 53| 5: [BlockStmt] { ... }
53-
# 53| 0: [ReturnStmt] return ...
54-
# 53| 0: [VarAccess] DefKt.p
55-
# 53| -1: [TypeAccess] DefKt
56-
# 53| 4: [FieldDeclaration] int p;
51+
# 57| 3: [TypeAccess] int
52+
# 57| 5: [BlockStmt] { ... }
53+
# 57| 0: [ReturnStmt] return ...
54+
# 57| 0: [VarAccess] DefKt.p
55+
# 57| -1: [TypeAccess] DefKt
56+
# 57| 4: [FieldDeclaration] int p;
5757
#-----| -2: (Annotations)
5858
# 56| 1: [Annotation] Annot0k
5959
# 21| 1: [IntegerLiteral] 0
60-
# 53| -1: [TypeAccess] int
60+
# 57| -1: [TypeAccess] int
6161
# 57| 0: [IntegerLiteral] 5
62-
# 53| 5: [Method] setP
62+
# 57| 5: [Method] setP
6363
#-----| 1: (Annotations)
6464
# 55| 1: [Annotation] Annot0k
6565
# 21| 1: [IntegerLiteral] 0
66-
# 53| 3: [TypeAccess] Unit
66+
# 57| 3: [TypeAccess] Unit
6767
#-----| 4: (Parameters)
68-
# 53| 0: [Parameter] <set-?>
69-
# 53| 0: [TypeAccess] int
70-
# 53| 5: [BlockStmt] { ... }
71-
# 53| 0: [ExprStmt] <Expr>;
72-
# 53| 0: [AssignExpr] ...=...
73-
# 53| 0: [VarAccess] DefKt.p
74-
# 53| -1: [TypeAccess] DefKt
75-
# 53| 1: [VarAccess] <set-?>
68+
# 57| 0: [Parameter] <set-?>
69+
# 57| 0: [TypeAccess] int
70+
# 57| 5: [BlockStmt] { ... }
71+
# 57| 0: [ExprStmt] <Expr>;
72+
# 57| 0: [AssignExpr] ...=...
73+
# 57| 0: [VarAccess] DefKt.p
74+
# 57| -1: [TypeAccess] DefKt
75+
# 57| 1: [VarAccess] <set-?>
7676
# 59| 6: [ExtensionMethod] myExtension
7777
# 59| 3: [TypeAccess] Unit
7878
#-----| 4: (Parameters)
@@ -219,13 +219,13 @@ def.kt:
219219
# 39| -1: [TypeAccess] Y
220220
# 39| 2: [VarAccess] Y.A
221221
# 39| -1: [TypeAccess] Y
222-
# 41| 1: [Constructor] Z
222+
# 42| 1: [Constructor] Z
223223
#-----| 1: (Annotations)
224224
# 41| 1: [Annotation] Annot0k
225225
# 21| 1: [IntegerLiteral] 0
226-
# 41| 5: [BlockStmt] { ... }
226+
# 42| 5: [BlockStmt] { ... }
227227
# 42| 0: [SuperConstructorInvocationStmt] super(...)
228-
# 41| 1: [BlockStmt] { ... }
228+
# 42| 1: [BlockStmt] { ... }
229229
use.java:
230230
# 0| [CompilationUnit] use
231231
# 1| 1: [Class] use

java/ql/test-kotlin2/library-tests/annotation_classes/classes.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ annotationDeclarations
1717
| Annot1j.java:1:19:1:25 | Annot1j | Annot1j.java:8:7:8:7 | d |
1818
| Annot1j.java:1:19:1:25 | Annot1j | Annot1j.java:10:9:10:9 | e |
1919
| Annot1j.java:1:19:1:25 | Annot1j | Annot1j.java:12:13:12:13 | f |
20-
| def.kt:5:1:21:60 | Annot0k | def.kt:21:26:21:59 | a |
20+
| def.kt:5:1:21:60 | Annot0k | def.kt:21:44:21:59 | a |
2121
| def.kt:23:1:31:1 | Annot1k | def.kt:25:5:25:18 | a |
2222
| def.kt:23:1:31:1 | Annot1k | def.kt:26:5:26:24 | b |
2323
| def.kt:23:1:31:1 | Annot1k | def.kt:27:5:27:31 | c |
@@ -29,12 +29,12 @@ annotations
2929
| def.kt:30:22:30:31 | Annot0k | def.kt:39:1:39:40 | Annot1k | def.kt:5:1:21:60 | Annot0k |
3030
| def.kt:38:1:38:17 | Annot0k | def.kt:38:1:43:1 | Z | def.kt:5:1:21:60 | Annot0k |
3131
| def.kt:39:1:39:40 | Annot1k | def.kt:38:1:43:1 | Z | def.kt:23:1:31:1 | Annot1k |
32-
| def.kt:41:5:41:12 | Annot0k | def.kt:41:5:42:19 | Z | def.kt:5:1:21:60 | Annot0k |
33-
| def.kt:45:1:45:8 | Annot0k | def.kt:45:1:51:1 | fn | def.kt:5:1:21:60 | Annot0k |
32+
| def.kt:41:5:41:12 | Annot0k | def.kt:42:5:42:19 | Z | def.kt:5:1:21:60 | Annot0k |
33+
| def.kt:45:1:45:8 | Annot0k | def.kt:46:1:51:1 | fn | def.kt:5:1:21:60 | Annot0k |
3434
| def.kt:46:21:46:28 | Annot0k | def.kt:46:21:46:39 | a | def.kt:5:1:21:60 | Annot0k |
35-
| def.kt:54:1:54:12 | Annot0k | def.kt:53:1:57:19 | getP | def.kt:5:1:21:60 | Annot0k |
36-
| def.kt:55:1:55:12 | Annot0k | def.kt:53:1:57:19 | setP | def.kt:5:1:21:60 | Annot0k |
37-
| def.kt:56:1:56:14 | Annot0k | def.kt:53:1:57:23 | p | def.kt:5:1:21:60 | Annot0k |
35+
| def.kt:54:1:54:12 | Annot0k | def.kt:57:1:57:19 | getP | def.kt:5:1:21:60 | Annot0k |
36+
| def.kt:55:1:55:12 | Annot0k | def.kt:57:1:57:19 | setP | def.kt:5:1:21:60 | Annot0k |
37+
| def.kt:56:1:56:14 | Annot0k | def.kt:57:1:57:23 | p | def.kt:5:1:21:60 | Annot0k |
3838
| def.kt:59:5:59:21 | Annot0k | def.kt:59:5:59:28 | <this> | def.kt:5:1:21:60 | Annot0k |
3939
| use.java:10:5:10:21 | Annot0j | use.java:14:18:14:18 | Z | Annot0j.java:1:19:1:25 | Annot0j |
4040
| use.java:11:5:11:90 | Annot1j | use.java:14:18:14:18 | Z | Annot1j.java:1:19:1:25 | Annot1j |
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
| Test.java:2:17:2:17 | m | m | m |
22
| test.kt:3:9:4:18 | getX_prop | getX_prop | getX |
33
| test.kt:6:5:6:19 | getX | getX | getX |
4-
| test.kt:8:5:10:14 | changeY | changeY | setY |
5-
| test.kt:8:5:10:14 | y | y | getY |
6-
| test.kt:12:5:13:15 | method | method | fn |
4+
| test.kt:10:5:10:14 | changeY | changeY | setY |
5+
| test.kt:10:5:10:14 | y | y | getY |
6+
| test.kt:13:5:13:15 | method | method | fn |
77
| test.kt:17:5:17:14 | p | p | p |
8-
| test.kt:18:5:18:32 | w | w | q |
8+
| test.kt:18:23:18:32 | w | w | q |

java/ql/test-kotlin2/library-tests/classes/ctorCalls.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ thisCall
22
| classes.kt:29:26:29:31 | this(...) |
33
superCall
44
| classes.kt:2:1:2:18 | super(...) |
5-
| classes.kt:4:16:4:29 | super(...) |
5+
| classes.kt:4:1:6:1 | super(...) |
66
| classes.kt:8:1:10:1 | super(...) |
7-
| classes.kt:12:23:12:34 | super(...) |
8-
| classes.kt:17:18:17:28 | super(...) |
9-
| classes.kt:28:19:28:29 | super(...) |
7+
| classes.kt:12:1:15:1 | super(...) |
8+
| classes.kt:17:1:18:1 | super(...) |
9+
| classes.kt:28:1:30:1 | super(...) |
1010
| classes.kt:35:27:35:27 | super(...) |
1111
| classes.kt:63:1:91:1 | super(...) |
1212
| classes.kt:66:20:66:54 | super(...) |
@@ -41,7 +41,7 @@ superCall
4141
| classes.kt:151:5:155:5 | super(...) |
4242
| classes.kt:159:5:159:14 | super(...) |
4343
| classes.kt:162:13:162:22 | super(...) |
44-
| generic_anonymous.kt:1:25:1:34 | super(...) |
44+
| generic_anonymous.kt:1:1:9:1 | super(...) |
4545
| generic_anonymous.kt:3:19:5:3 | super(...) |
4646
| generic_anonymous.kt:15:1:33:1 | super(...) |
4747
| generic_anonymous.kt:25:9:31:9 | super(...) |
@@ -64,5 +64,5 @@ superCall
6464
| local_anonymous.kt:39:1:45:1 | super(...) |
6565
| local_anonymous.kt:40:14:44:5 | super(...) |
6666
| superChain.kt:1:1:1:33 | super(...) |
67-
| superChain.kt:2:33:2:57 | super(...) |
68-
| superChain.kt:3:33:3:57 | super(...) |
67+
| superChain.kt:2:1:2:60 | super(...) |
68+
| superChain.kt:3:1:3:60 | super(...) |

java/ql/test-kotlin2/library-tests/classes/genericExprTypes.expected

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
| generic_anonymous.kt:1:26:1:33 | t | T |
77
| generic_anonymous.kt:1:26:1:33 | this | Generic |
88
| generic_anonymous.kt:1:26:1:33 | this.t | T |
9-
| generic_anonymous.kt:3:3:3:15 | T | T |
10-
| generic_anonymous.kt:3:3:3:15 | new Object(...) { ... } | new Object(...) { ... } |
11-
| generic_anonymous.kt:3:3:3:15 | this | Generic |
12-
| generic_anonymous.kt:3:3:3:15 | this.x | new Object(...) { ... } |
13-
| generic_anonymous.kt:3:3:5:3 | ...=... | new Object(...) { ... } |
14-
| generic_anonymous.kt:3:3:5:3 | T | T |
15-
| generic_anonymous.kt:3:3:5:3 | new Object(...) { ... } | new Object(...) { ... } |
16-
| generic_anonymous.kt:3:3:5:3 | x | new Object(...) { ... } |
9+
| generic_anonymous.kt:3:11:3:15 | T | T |
10+
| generic_anonymous.kt:3:11:3:15 | new Object(...) { ... } | new Object(...) { ... } |
11+
| generic_anonymous.kt:3:11:3:15 | this | Generic |
12+
| generic_anonymous.kt:3:11:3:15 | this.x | new Object(...) { ... } |
13+
| generic_anonymous.kt:3:11:5:3 | ...=... | new Object(...) { ... } |
14+
| generic_anonymous.kt:3:11:5:3 | T | T |
15+
| generic_anonymous.kt:3:11:5:3 | new Object(...) { ... } | new Object(...) { ... } |
16+
| generic_anonymous.kt:3:11:5:3 | x | new Object(...) { ... } |
1717
| generic_anonymous.kt:3:19:5:3 | <Stmt> | new Object(...) { ... } |
1818
| generic_anonymous.kt:3:19:5:3 | Object | Object |
1919
| generic_anonymous.kt:3:19:5:3 | new (...) | new Object(...) { ... } |

java/ql/test-kotlin2/library-tests/comments/comments.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ comments
1818
commentOwners
1919
| comments.kt:1:1:1:36 | /** Kdoc owned by CompilationUnit */ | comments.kt:0:0:0:0 | comments |
2020
| comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group |
21-
| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:5:17:23 | getMembers$private |
22-
| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:5:17:46 | members |
23-
| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:5:17:46 | members |
21+
| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:23 | getMembers$private |
22+
| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | members |
23+
| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | members |
2424
| comments.kt:19:5:22:7 | /**\n * Adds a [member] to this group.\n * @return the new size of the group.\n */ | comments.kt:23:5:26:5 | add |
2525
| comments.kt:48:1:50:3 | /**\n * A type alias comment\n */ | comments.kt:51:1:51:24 | MyType |
2626
| comments.kt:61:5:63:7 | /**\n * A prop comment\n */ | comments.kt:64:5:68:17 | prop |

java/ql/test-kotlin2/library-tests/companion_objects/method_accesses.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
| companion_objects.kt:23:5:23:11 | MyClassCompanion | VarAccess | companion_objects.kt:4:9:4:31 | funInCompanion |
33
| companion_objects.kt:24:5:24:13 | new MyClass(...) | ClassInstanceExpr | companion_objects.kt:2:5:2:23 | funInClass |
44
| companion_objects.kt:25:5:25:15 | MyInterfaceCompanion | VarAccess | companion_objects.kt:11:9:11:31 | funInCompanion |
5-
| companion_objects.kt:26:5:26:9 | new Imp(...) | ClassInstanceExpr | companion_objects.kt:16:5:18:5 | funInInterface |
5+
| companion_objects.kt:26:5:26:9 | new Imp(...) | ClassInstanceExpr | companion_objects.kt:16:14:18:5 | funInInterface |

java/ql/test-kotlin2/library-tests/data-classes/PrintAst.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ dc.kt:
9393
# 0| 0: [BooleanLiteral] false
9494
# 0| 2: [LocalVariableDeclStmt] var ...;
9595
# 0| 1: [LocalVariableDeclExpr] tmp0_other_with_cast
96-
# 0| 0: [CastExpr] (...)...
96+
# 0| 0: [ImplicitCastExpr] <implicit cast>
9797
# 0| 0: [TypeAccess] ProtoMapValue
9898
# 0| 1: [VarAccess] other
9999
# 0| 3: [ExprStmt] <Expr>;

0 commit comments

Comments
 (0)