Get call expression type from compile time value if possible

This commit is contained in:
Natalia Ukhorskaya
2013-12-03 18:46:44 +04:00
parent e6c442ba04
commit e805478d6c
5 changed files with 42 additions and 2 deletions
@@ -0,0 +1,26 @@
fun fooInt(p: Int) = p
fun fooLong(p: Long) = p
fun fooByte(p: Byte) = p
fun fooShort(p: Short) = p
fun test() {
fooInt(1.plus(1))
fooByte(1.plus(1))
fooLong(1.plus(1))
fooShort(1.plus(1))
fooInt(1.times(1))
fooByte(1.times(1))
fooLong(1.times(1))
fooShort(1.times(1))
fooInt(1.div(1))
fooByte(1.div(1))
fooLong(1.div(1))
fooShort(1.div(1))
fooInt(1.mod(1))
fooByte(1.mod(1))
fooLong(1.mod(1))
fooShort(1.mod(1))
}
@@ -10,4 +10,4 @@ annotation class Ann(
Ann(1.plus(1), 1.minus(1), 1.times(1), 1.div(1), 1.mod(1)) class MyClass
// EXPECTED: Ann[p1 = 2.toInt(): jet.Int, p2 = 0.toInt(): jet.Int, p3 = 1.toInt(): jet.Int, p4 = 1.toInt(): jet.Int, p5 = 0.toInt(): jet.Int]
// EXPECTED: Ann[p1 = IntegerValueType(2): IntegerValueType(2), p2 = IntegerValueType(0): IntegerValueType(0), p3 = IntegerValueType(1): IntegerValueType(1), p4 = IntegerValueType(1): IntegerValueType(1), p5 = IntegerValueType(0): IntegerValueType(0)]