Support '.toType()' and literal fixes related to unsigned type mismatch
#KT-26836 Fixed
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// ERROR: Conversion of signed constants to unsigned ones is prohibited
|
||||
// ACTION: Change parameter 'u' type of function 'takeUInt' to 'Int'
|
||||
// ACTION: Convert property initializer to getter
|
||||
// ACTION: Change to '1u'
|
||||
// ACTION: Do not show hints for current method
|
||||
// ACTION: Add 'u =' to argument
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Convert expression to 'Int'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: Int) {}
|
||||
|
||||
fun test(expr: UInt) {
|
||||
foo(<caret>expr)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Convert expression to 'Int'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: Int) {}
|
||||
|
||||
fun test(expr: UInt) {
|
||||
foo(expr.toInt())
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Convert expression to 'UInt'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: UInt) {}
|
||||
|
||||
fun test(expr: Int) {
|
||||
foo(<caret>expr)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert expression to 'UInt'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: UInt) {}
|
||||
|
||||
fun test(expr: Int) {
|
||||
foo(expr.toUInt())
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Change to '1u'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: UInt) {}
|
||||
|
||||
fun test() {
|
||||
foo(<caret>1)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Change to '1u'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: UInt) {}
|
||||
|
||||
fun test() {
|
||||
foo(1u)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Change to '1'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: Int) {}
|
||||
|
||||
fun test() {
|
||||
foo(<caret>1u)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Change to '1'" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo(param: Int) {}
|
||||
|
||||
fun test() {
|
||||
foo(1)
|
||||
}
|
||||
Reference in New Issue
Block a user