Kotlin: add numeric unary operator test cases

This commit is contained in:
Tamas Vajk
2022-10-04 11:05:27 +02:00
committed by Tamás Vajk
parent 264d74f996
commit 2e72ec748f
4 changed files with 192 additions and 0 deletions

View File

@@ -11,6 +11,14 @@
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Byte.toInt in java.lang.Byte |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Byte.toInt in java.lang.Byte |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.inc in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.inc in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.inc in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.inc in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.rangeTo in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.rangeTo in java.lang.Integer |
| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Short.toInt in java.lang.Short |

View File

@@ -2855,6 +2855,106 @@ exprs.kt:
# 276| 1: [MethodAccess] getEnumValues(...)
# 276| -2: [TypeAccess] Color
# 276| -1: [TypeAccess] ExprsKt
# 279| 14: [Method] unaryExprs
# 279| 3: [TypeAccess] Unit
#-----| 4: (Parameters)
# 279| 0: [Parameter] i
# 279| 0: [TypeAccess] int
# 279| 1: [Parameter] d
# 279| 0: [TypeAccess] double
# 279| 5: [BlockStmt] { ... }
# 280| 0: [ExprStmt] <Expr>;
# 280| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 280| 0: [TypeAccess] Unit
# 281| 1: [ExprStmt] <Expr>;
# 281| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 281| 0: [TypeAccess] Unit
# 282| 2: [ExprStmt] <Expr>;
# 282| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 282| 0: [TypeAccess] Unit
# 283| 3: [ExprStmt] <Expr>;
# 283| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 283| 0: [TypeAccess] Unit
# 284| 4: [LocalVariableDeclStmt] var ...;
# 284| 1: [LocalVariableDeclExpr] i0
# 284| 0: [IntegerLiteral] 1
# 285| 5: [LocalVariableDeclStmt] var ...;
# 285| 1: [LocalVariableDeclExpr] i1
# 285| 0: [IntegerLiteral] 1
# 286| 6: [ExprStmt] <Expr>;
# 286| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 286| 0: [TypeAccess] Unit
# 286| 1: [StmtExpr] <Stmt>
# 286| 0: [BlockStmt] { ... }
# 286| 0: [LocalVariableDeclStmt] var ...;
# 286| 1: [LocalVariableDeclExpr] tmp0
# 286| 0: [VarAccess] i0
# 286| 1: [ExprStmt] <Expr>;
# 286| 0: [AssignExpr] ...=...
# 286| 0: [VarAccess] i0
# 286| 1: [MethodAccess] inc(...)
# 286| -1: [VarAccess] tmp0
# 286| 2: [ExprStmt] <Expr>;
# 286| 0: [VarAccess] tmp0
# 287| 7: [ExprStmt] <Expr>;
# 287| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 287| 0: [TypeAccess] Unit
# 287| 1: [StmtExpr] <Stmt>
# 287| 0: [BlockStmt] { ... }
# 287| 0: [ExprStmt] <Expr>;
# 287| 0: [AssignExpr] ...=...
# 287| 0: [VarAccess] i0
# 287| 1: [MethodAccess] inc(...)
# 287| -1: [VarAccess] i0
# 287| 1: [ExprStmt] <Expr>;
# 287| 0: [VarAccess] i0
# 288| 8: [ExprStmt] <Expr>;
# 288| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 288| 0: [TypeAccess] Unit
# 288| 1: [StmtExpr] <Stmt>
# 288| 0: [BlockStmt] { ... }
# 288| 0: [LocalVariableDeclStmt] var ...;
# 288| 1: [LocalVariableDeclExpr] tmp1
# 288| 0: [VarAccess] i0
# 288| 1: [ExprStmt] <Expr>;
# 288| 0: [AssignExpr] ...=...
# 288| 0: [VarAccess] i0
# 288| 1: [MethodAccess] dec(...)
# 288| -1: [VarAccess] tmp1
# 288| 2: [ExprStmt] <Expr>;
# 288| 0: [VarAccess] tmp1
# 289| 9: [ExprStmt] <Expr>;
# 289| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 289| 0: [TypeAccess] Unit
# 289| 1: [StmtExpr] <Stmt>
# 289| 0: [BlockStmt] { ... }
# 289| 0: [ExprStmt] <Expr>;
# 289| 0: [AssignExpr] ...=...
# 289| 0: [VarAccess] i0
# 289| 1: [MethodAccess] dec(...)
# 289| -1: [VarAccess] i0
# 289| 1: [ExprStmt] <Expr>;
# 289| 0: [VarAccess] i0
# 290| 10: [ExprStmt] <Expr>;
# 290| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 290| 0: [TypeAccess] Unit
# 290| 1: [MethodAccess] inc(...)
# 290| -1: [VarAccess] i0
# 291| 11: [ExprStmt] <Expr>;
# 291| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 291| 0: [TypeAccess] Unit
# 291| 1: [MethodAccess] dec(...)
# 291| -1: [VarAccess] i0
# 292| 12: [ExprStmt] <Expr>;
# 292| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 292| 0: [TypeAccess] Unit
# 292| 1: [MethodAccess] inc(...)
# 292| -1: [VarAccess] i1
# 293| 13: [ExprStmt] <Expr>;
# 293| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
# 293| 0: [TypeAccess] Unit
# 293| 1: [MethodAccess] dec(...)
# 293| -1: [VarAccess] i1
# 142| 2: [Class] C
# 142| 1: [Constructor] C
#-----| 4: (Parameters)

View File

@@ -1738,6 +1738,73 @@
| exprs.kt:276:5:276:26 | ExprsKt | exprs.kt:274:1:277:1 | callToEnumValues | TypeAccess |
| exprs.kt:276:5:276:26 | Unit | exprs.kt:274:1:277:1 | callToEnumValues | TypeAccess |
| exprs.kt:276:5:276:26 | getEnumValues(...) | exprs.kt:274:1:277:1 | callToEnumValues | MethodAccess |
| exprs.kt:279:1:294:1 | Unit | file://:0:0:0:0 | <none> | TypeAccess |
| exprs.kt:279:16:279:21 | int | file://:0:0:0:0 | <none> | TypeAccess |
| exprs.kt:279:24:279:32 | double | file://:0:0:0:0 | <none> | TypeAccess |
| exprs.kt:280:5:280:6 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:280:5:280:6 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:281:5:281:6 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:281:5:281:6 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:282:5:282:6 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:282:5:282:6 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:283:5:283:6 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:283:5:283:6 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:284:5:284:14 | i0 | exprs.kt:279:1:294:1 | unaryExprs | LocalVariableDeclExpr |
| exprs.kt:284:14:284:14 | 1 | exprs.kt:279:1:294:1 | unaryExprs | IntegerLiteral |
| exprs.kt:285:5:285:14 | i1 | exprs.kt:279:1:294:1 | unaryExprs | LocalVariableDeclExpr |
| exprs.kt:285:14:285:14 | 1 | exprs.kt:279:1:294:1 | unaryExprs | IntegerLiteral |
| exprs.kt:286:5:286:6 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:286:5:286:6 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:286:5:286:8 | ...=... | exprs.kt:279:1:294:1 | unaryExprs | AssignExpr |
| exprs.kt:286:5:286:8 | <Stmt> | exprs.kt:279:1:294:1 | unaryExprs | StmtExpr |
| exprs.kt:286:5:286:8 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:286:5:286:8 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:286:5:286:8 | inc(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:286:5:286:8 | tmp0 | exprs.kt:279:1:294:1 | unaryExprs | LocalVariableDeclExpr |
| exprs.kt:286:5:286:8 | tmp0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:286:5:286:8 | tmp0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:287:5:287:8 | <Stmt> | exprs.kt:279:1:294:1 | unaryExprs | StmtExpr |
| exprs.kt:287:5:287:8 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:287:5:287:8 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:287:5:287:8 | inc(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:287:7:287:8 | ...=... | exprs.kt:279:1:294:1 | unaryExprs | AssignExpr |
| exprs.kt:287:7:287:8 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:287:7:287:8 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:287:7:287:8 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:288:5:288:6 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:288:5:288:6 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:288:5:288:8 | ...=... | exprs.kt:279:1:294:1 | unaryExprs | AssignExpr |
| exprs.kt:288:5:288:8 | <Stmt> | exprs.kt:279:1:294:1 | unaryExprs | StmtExpr |
| exprs.kt:288:5:288:8 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:288:5:288:8 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:288:5:288:8 | dec(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:288:5:288:8 | tmp1 | exprs.kt:279:1:294:1 | unaryExprs | LocalVariableDeclExpr |
| exprs.kt:288:5:288:8 | tmp1 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:288:5:288:8 | tmp1 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:289:5:289:8 | <Stmt> | exprs.kt:279:1:294:1 | unaryExprs | StmtExpr |
| exprs.kt:289:5:289:8 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:289:5:289:8 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:289:5:289:8 | dec(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:289:7:289:8 | ...=... | exprs.kt:279:1:294:1 | unaryExprs | AssignExpr |
| exprs.kt:289:7:289:8 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:289:7:289:8 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:289:7:289:8 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:290:5:290:6 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:290:8:290:12 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:290:8:290:12 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:290:8:290:12 | inc(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:291:5:291:6 | i0 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:291:8:291:12 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:291:8:291:12 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:291:8:291:12 | dec(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:292:5:292:6 | i1 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:292:8:292:12 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:292:8:292:12 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:292:8:292:12 | inc(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| exprs.kt:293:5:293:6 | i1 | exprs.kt:279:1:294:1 | unaryExprs | VarAccess |
| exprs.kt:293:8:293:12 | <implicit coercion to unit> | exprs.kt:279:1:294:1 | unaryExprs | ImplicitCoercionToUnitExpr |
| exprs.kt:293:8:293:12 | Unit | exprs.kt:279:1:294:1 | unaryExprs | TypeAccess |
| exprs.kt:293:8:293:12 | dec(...) | exprs.kt:279:1:294:1 | unaryExprs | MethodAccess |
| funcExprs.kt:1:1:1:46 | Unit | file://:0:0:0:0 | <none> | TypeAccess |
| funcExprs.kt:1:26:1:37 | Function0<Integer> | file://:0:0:0:0 | <none> | TypeAccess |
| funcExprs.kt:1:26:1:37 | Integer | file://:0:0:0:0 | <none> | TypeAccess |

View File

@@ -275,3 +275,20 @@ fun callToEnumValues() {
enumValues<Color>()
getEnumValues<Color>()
}
fun unaryExprs(i: Int, d: Double) {
-i
+i
-d
+d
var i0 = 1
val i1 = 1
i0++
++i0
i0--
--i0
i0.inc()
i0.dec()
i1.inc()
i1.dec()
}