Add test for return type of <clinit> methods

This commit is contained in:
Tamas Vajk
2022-05-10 10:38:59 +02:00
committed by Chris Smowton
parent b0ee557a51
commit de003fd122
6 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1 @@
| clinit.kt:0:0:0:0 | <clinit> | file:///usr/local/Cellar/kotlin/1.6.20/libexec/lib/kotlin-stdlib.jar/kotlin/Unit.class:0:0:0:0 | Unit |

View File

@@ -0,0 +1,3 @@
package foo.bar
var topLevelInt: Int = 0

View File

@@ -0,0 +1,5 @@
import java
from Method m
where m.getName() = "<clinit>"
select m, m.getReturnType()

View File

@@ -1,3 +1,17 @@
| clinit.kt:3:1:3:24 | ...=... | AssignExpr |
| clinit.kt:3:1:3:24 | ...=... | KtInitializerAssignExpr |
| clinit.kt:3:1:3:24 | <set-?> | VarAccess |
| clinit.kt:3:1:3:24 | ClinitKt | TypeAccess |
| clinit.kt:3:1:3:24 | ClinitKt | TypeAccess |
| clinit.kt:3:1:3:24 | ClinitKt | TypeAccess |
| clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess |
| clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess |
| clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess |
| clinit.kt:3:1:3:24 | Unit | TypeAccess |
| clinit.kt:3:1:3:24 | int | TypeAccess |
| clinit.kt:3:1:3:24 | int | TypeAccess |
| clinit.kt:3:1:3:24 | int | TypeAccess |
| clinit.kt:3:24:3:24 | 0 | IntegerLiteral |
| methods2.kt:4:1:5:1 | Unit | TypeAccess |
| methods2.kt:4:26:4:31 | int | TypeAccess |
| methods2.kt:4:34:4:39 | int | TypeAccess |

View File

@@ -1,4 +1,7 @@
methods
| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:0:0:0:0 | <clinit> | <clinit>() | |
| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | getTopLevelInt | getTopLevelInt() | public, static |
| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | setTopLevelInt | setTopLevelInt(int) | public, static |
| methods2.kt:0:0:0:0 | Methods2Kt | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | fooBarTopLevelMethod(int,int) | public, static |
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:8:5:9:5 | fooBarClassMethod | fooBarClassMethod(int,int) | public |
| methods3.kt:0:0:0:0 | Methods3Kt | methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) | public, static |

View File

@@ -1,3 +1,4 @@
| clinit.kt:3:1:3:24 | setTopLevelInt | clinit.kt:3:1:3:24 | <set-?> | 0 |
| methods2.kt:4:1:5:1 | fooBarTopLevelMethod | methods2.kt:4:26:4:31 | x | 0 |
| methods2.kt:4:1:5:1 | fooBarTopLevelMethod | methods2.kt:4:34:4:39 | y | 1 |
| methods2.kt:8:5:9:5 | fooBarClassMethod | methods2.kt:8:27:8:32 | x | 0 |