File tree Expand file tree Collapse file tree
test/kotlin/library-tests/exprs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2143,9 +2143,7 @@ class WhenExpr extends Expr, @whenexpr {
21432143 override string getAPrimaryQlClass ( ) { result = "WhenExpr" }
21442144
21452145 /** Gets the `i`th branch. */
2146- WhenBranch getBranch ( int i ) {
2147- when_branch ( result , this , i )
2148- }
2146+ WhenBranch getBranch ( int i ) { when_branch ( result , this , i ) }
21492147}
21502148
21512149/** A Kotlin `when` branch. */
@@ -2163,3 +2161,13 @@ class WhenBranch extends Top, @whenbranch {
21632161
21642162 override string getAPrimaryQlClass ( ) { result = "WhenBranch" }
21652163}
2164+
2165+ /** A Kotlin `::class` expression. */
2166+ class ClassExpr extends Expr , @getclassexpr {
2167+ /** Gets the expression whose class is being returned. */
2168+ Expr getExpr ( ) { result .isNthChildOf ( this , 0 ) }
2169+
2170+ override string toString ( ) { result = "::class" }
2171+
2172+ override string getAPrimaryQlClass ( ) { result = "ClassExpr" }
2173+ }
Original file line number Diff line number Diff line change 4141| exprs.kt:46:12:46:14 | 123 | IntegerLiteral |
4242| exprs.kt:46:12:46:20 | ... + ... | AddExpr |
4343| exprs.kt:46:18:46:20 | 456 | IntegerLiteral |
44+ | exprs.kt:50:13:50:16 | true | BooleanLiteral |
45+ | exprs.kt:50:13:50:23 | ::class | ClassExpr |
4446| file://:0:0:0:0 | b1 | LocalVariableDeclExpr |
4547| file://:0:0:0:0 | b2 | LocalVariableDeclExpr |
4648| file://:0:0:0:0 | b6 | LocalVariableDeclExpr |
4749| file://:0:0:0:0 | b7 | LocalVariableDeclExpr |
4850| file://:0:0:0:0 | b8 | LocalVariableDeclExpr |
4951| file://:0:0:0:0 | c | LocalVariableDeclExpr |
52+ | file://:0:0:0:0 | d | LocalVariableDeclExpr |
5053| file://:0:0:0:0 | i1 | LocalVariableDeclExpr |
5154| file://:0:0:0:0 | i2 | LocalVariableDeclExpr |
5255| file://:0:0:0:0 | i3 | LocalVariableDeclExpr |
Original file line number Diff line number Diff line change 4646 return 123 + 456
4747}
4848
49+ fun getClass () {
50+ val d = true ::class
51+ }
You can’t perform that action at this time.
0 commit comments