[FIR] Approximate all integer literals which resolved in independent mode
#KT-42016
This commit is contained in:
+11
-11
@@ -31,33 +31,33 @@ fun test_3() {
|
||||
fun takeByte(b: Byte) {}
|
||||
|
||||
fun test_4() {
|
||||
takeByte(1 + 1)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 + 1)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 + 127)
|
||||
takeByte(1 - 1)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 - 1)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(-100 - 100)
|
||||
takeByte(10 * 10)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(10 * 10)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(100 * 100)
|
||||
<!UNRESOLVED_REFERENCE!>taleByte<!>(10 / 10)
|
||||
takeByte(100 % 10)
|
||||
takeByte(1000 % 10)
|
||||
takeByte(1000 and 100)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(100 % 10)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000 % 10)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000 and 100)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(128 and 511)
|
||||
takeByte(100 or 100)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(100 or 100)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000 or 0)
|
||||
takeByte(511 xor 511)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(511 xor 511)
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(512 xor 511)
|
||||
}
|
||||
|
||||
fun test_5() {
|
||||
takeByte(-1)
|
||||
takeByte(+1)
|
||||
takeByte(1.inv())
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1.inv())
|
||||
}
|
||||
|
||||
fun test_6() {
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(run { 127 + 1 })
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 + run { 1 })
|
||||
takeByte(run { 1 + 1 })
|
||||
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(run { 1 + 1 })
|
||||
1 + 1
|
||||
run { 1 }
|
||||
1 + run { 1 }
|
||||
@@ -66,4 +66,4 @@ fun test_6() {
|
||||
fun test_7(d: Double) {
|
||||
val x1 = 1 + d
|
||||
val x2 = d + 1
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -29,37 +29,37 @@ FILE: operatorsOverLiterals.kt
|
||||
public final fun takeByte(b: R|kotlin/Byte|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test_4(): R|kotlin/Unit| {
|
||||
R|/takeByte|(Byte(1).R|kotlin/Byte.plus|(Byte(1)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.plus|(Int(1)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.plus|(Int(127)))
|
||||
R|/takeByte|(Byte(1).R|kotlin/Byte.minus|(Byte(1)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.minus|(Int(1)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(-100).R|kotlin/Int.minus|(Int(100)))
|
||||
R|/takeByte|(Byte(10).R|kotlin/Byte.times|(Byte(10)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(10).R|kotlin/Int.times|(Int(10)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(100).R|kotlin/Int.times|(Int(100)))
|
||||
<Unresolved name: taleByte>#(Int(10).R|kotlin/Int.div|(Int(10)))
|
||||
R|/takeByte|(Byte(100).R|kotlin/Byte.rem|(Byte(10)))
|
||||
R|/takeByte|(Int(1000).R|kotlin/Int.rem|(Byte(10)))
|
||||
R|/takeByte|(Int(1000).R|<local>/and|(Byte(100)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(100).R|kotlin/Int.rem|(Int(10)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1000).R|kotlin/Int.rem|(Int(10)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1000).R|kotlin/Int.and|(Int(100)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(128).R|kotlin/Int.and|(Int(511)))
|
||||
R|/takeByte|(Byte(100).R|<local>/or|(Byte(100)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(100).R|kotlin/Int.or|(Int(100)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1000).R|kotlin/Int.or|(Int(0)))
|
||||
R|/takeByte|(Int(511).R|kotlin/Int.xor|(Int(511)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(511).R|kotlin/Int.xor|(Int(511)))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(512).R|kotlin/Int.xor|(Int(511)))
|
||||
}
|
||||
public final fun test_5(): R|kotlin/Unit| {
|
||||
R|/takeByte|(Byte(-1))
|
||||
R|/takeByte|(Byte(1))
|
||||
R|/takeByte|(Byte(1).R|<local>/inv|())
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.inv|())
|
||||
}
|
||||
public final fun test_6(): R|kotlin/Unit| {
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
|
||||
^ Int(127).R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
))
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|<local>/plus|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.plus|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
|
||||
^ Int(1)
|
||||
}
|
||||
)))
|
||||
R|/takeByte|(R|kotlin/run|<R|kotlin/Byte|>(<L> = run@fun <anonymous>(): R|kotlin/Byte| <kind=EXACTLY_ONCE> {
|
||||
<Inapplicable(INAPPLICABLE): /takeByte>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
|
||||
^ Int(1).R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
))
|
||||
|
||||
@@ -16,12 +16,12 @@ class B3_3 : A3("", true)
|
||||
class B3_4 : <!NONE_APPLICABLE!>A3<!>("", Unit)
|
||||
|
||||
open class A4(val x: Byte)
|
||||
class B4 : A4( 1 + 1)
|
||||
class B4 : <!INAPPLICABLE_CANDIDATE!>A4<!>( 1 + 1)
|
||||
|
||||
open class A5 {
|
||||
constructor(x: Byte)
|
||||
constructor(x: Short)
|
||||
}
|
||||
|
||||
class B5_1 : A5(1 + 1)
|
||||
class B5_2 : A5(100 * 2)
|
||||
class B5_1 : <!NONE_APPLICABLE!>A5<!>(1 + 1)
|
||||
class B5_2 : <!NONE_APPLICABLE!>A5<!>(100 * 2)
|
||||
|
||||
@@ -77,7 +77,7 @@ FILE: delegatingConstructorCall.kt
|
||||
}
|
||||
public final class B4 : R|A4| {
|
||||
public constructor(): R|B4| {
|
||||
super<R|A4|>(Byte(1).R|kotlin/Byte.plus|(Byte(1)))
|
||||
super<R|A4|>(Int(1).R|kotlin/Int.plus|(Int(1)))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -93,13 +93,13 @@ FILE: delegatingConstructorCall.kt
|
||||
}
|
||||
public final class B5_1 : R|A5| {
|
||||
public constructor(): R|B5_1| {
|
||||
super<R|A5|>(Short(1).R|kotlin/Short.plus|(Short(1)))
|
||||
super<R|A5|>(Int(1).R|kotlin/Int.plus|(Int(1)))
|
||||
}
|
||||
|
||||
}
|
||||
public final class B5_2 : R|A5| {
|
||||
public constructor(): R|B5_2| {
|
||||
super<R|A5|>(Short(100).R|kotlin/Short.times|(Short(2)))
|
||||
super<R|A5|>(Int(100).R|kotlin/Int.times|(Int(2)))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user