FIR: introduce three diagnostics for const val

This commit is contained in:
zadorotskas
2021-03-05 12:51:26 +03:00
committed by Mikhail Glukhikh
parent cc106085e2
commit 334d0a8b5a
23 changed files with 451 additions and 200 deletions
@@ -1,7 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
fun Int.mod(other: Int) = 10
fun Int.floorDiv(other: Int): Int = 20
const val a1 = (-5).mod(2)
const val b1 = 5.floorDiv(3)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
fun Int.mod(other: Int) = 10
@@ -17,6 +17,6 @@ val a11 = <!DIVISION_BY_ZERO!>1 / 0.0<!>
val a12 = <!DIVISION_BY_ZERO!>1L / 0<!>
val b1: Byte = <!DIVISION_BY_ZERO!>1 / 0<!>
@Ann(<!DIVISION_BY_ZERO!>1 / 0<!>) val b2 = 1
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, DIVISION_BY_ZERO!>1 / 0<!>) val b2 = 1
annotation class Ann(val i : Int)