Make NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION error
This commit is contained in:
@@ -7,8 +7,16 @@ Compiling files:
|
||||
module1/src/module1_const.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module1/META-INF/module1.kotlin_module
|
||||
out/production/module1/test/Module1_constKt.class
|
||||
out/production/module1/test/TestPackage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
module1/src/module1_const.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module2/usage/Usage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
module2/src/module2_usage.kt
|
||||
End of files
|
||||
End of files
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package test
|
||||
|
||||
public val CONST: String = "BF"
|
||||
public const val CONST: String = "BF"
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package test
|
||||
|
||||
public val CONST: String = "Ae"
|
||||
public const val CONST: String = "Ae"
|
||||
|
||||
@@ -17,8 +17,12 @@ Compiling files:
|
||||
src/const.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/ConstKt.class
|
||||
out/production/module/test/TestPackage.class
|
||||
out/production/module/test/Usage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/const.kt
|
||||
src/usage.kt
|
||||
End of files
|
||||
End of files
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
val b: Byte = 100
|
||||
val s: Short = 20000
|
||||
val i: Int = 2000000
|
||||
val l: Long = 2000000000000L
|
||||
val f: Float = 3.14f
|
||||
val d: Double = 3.14
|
||||
val bb: Boolean = true
|
||||
val c: Char = '\u03c0' // pi symbol
|
||||
const val b: Byte = 100
|
||||
const val s: Short = 20000
|
||||
const val i: Int = 2000000
|
||||
const val l: Long = 2000000000000L
|
||||
const val f: Float = 3.14f
|
||||
const val d: Double = 3.14
|
||||
const val bb: Boolean = true
|
||||
const val c: Char = '\u03c0' // pi symbol
|
||||
|
||||
val str: String = ":)"
|
||||
const val str: String = ":)"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
val b: Byte = 50 + 50
|
||||
val s: Short = 10000 + 10000
|
||||
val i: Int = 1000000 + 1000000
|
||||
val l: Long = 1000000000000L + 1000000000000L
|
||||
val f: Float = 0.0f + 3.14f
|
||||
val d: Double = 0.0 + 3.14
|
||||
val bb: Boolean = !false
|
||||
val c: Char = '\u03c0' // pi symbol
|
||||
const val b: Byte = 50 + 50
|
||||
const val s: Short = 10000 + 10000
|
||||
const val i: Int = 1000000 + 1000000
|
||||
const val l: Long = 1000000000000L + 1000000000000L
|
||||
const val f: Float = 0.0f + 3.14f
|
||||
const val d: Double = 0.0 + 3.14
|
||||
const val bb: Boolean = !false
|
||||
const val c: Char = '\u03c0' // pi symbol
|
||||
|
||||
val str: String = ":)"
|
||||
const val str: String = ":)"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
val b: Byte = 0
|
||||
val s: Short = 0
|
||||
val i: Int = 0
|
||||
val l: Long = 0
|
||||
val f: Float = 0.0f
|
||||
val d: Double = 0.0
|
||||
val bb: Boolean = false
|
||||
val c: Char = 'x'
|
||||
const val b: Byte = 0
|
||||
const val s: Short = 0
|
||||
const val i: Int = 0
|
||||
const val l: Long = 0
|
||||
const val f: Float = 0.0f
|
||||
const val d: Double = 0.0
|
||||
const val bb: Boolean = false
|
||||
const val c: Char = 'x'
|
||||
|
||||
val str: String = ":("
|
||||
const val str: String = ":("
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@ package test
|
||||
class Klass {
|
||||
companion object {
|
||||
// Old and new constant values are different, but their hashes are the same
|
||||
val CONST = "BF"
|
||||
const val CONST = "BF"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@ package test
|
||||
class Klass {
|
||||
companion object {
|
||||
// Old and new constant values are different, but their hashes are the same
|
||||
val CONST = "Ae"
|
||||
const val CONST = "Ae"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package test
|
||||
|
||||
val CONST = "foo"
|
||||
const val CONST = "foo"
|
||||
|
||||
class Klass {
|
||||
companion object {
|
||||
val CONST = "bar"
|
||||
const val CONST = "bar"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package test
|
||||
|
||||
val CONST = "foo"
|
||||
const val CONST = "foo"
|
||||
|
||||
class Klass {
|
||||
companion object {
|
||||
val CONST = "bar"
|
||||
const val CONST = "bar"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package test
|
||||
|
||||
val CONST = "foo"
|
||||
const val CONST = "foo"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
object Object {
|
||||
val CONST = "old"
|
||||
const val CONST = "old"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
object Object {
|
||||
val CONST = "new"
|
||||
const val CONST = "new"
|
||||
}
|
||||
|
||||
+5
-1
@@ -7,8 +7,12 @@ Compiling files:
|
||||
src/const.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/ConstKt.class
|
||||
out/production/module/test/TestPackage.class
|
||||
out/production/module/test/Usage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/const.kt
|
||||
src/usage.kt
|
||||
End of files
|
||||
End of files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package test
|
||||
|
||||
// Old and new constant values are different, but their hashes are the same
|
||||
val CONST = "BF"
|
||||
const val CONST = "BF"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package test
|
||||
|
||||
// Old and new constant values are different, but their hashes are the same
|
||||
val CONST = "Ae"
|
||||
const val CONST = "Ae"
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
package test
|
||||
|
||||
val CONST = "foo"
|
||||
const val CONST = "foo"
|
||||
|
||||
class Klass {
|
||||
companion object {
|
||||
private val CHANGED = "old"
|
||||
public val UNCHANGED = 100
|
||||
const public val UNCHANGED = 100
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
package test
|
||||
|
||||
val CONST = "foo"
|
||||
const val CONST = "foo"
|
||||
|
||||
class Klass {
|
||||
companion object {
|
||||
private val CHANGED = "new"
|
||||
public val UNCHANGED = 100
|
||||
const public val UNCHANGED = 100
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user