[PowerAssert] Correctly align infix calls with string const receivers
^KT-65640 Fixed
This commit is contained in:
-1
@@ -192,7 +192,6 @@ private fun memberAccessOffset(
|
|||||||
?: return 0
|
?: return 0
|
||||||
val expressionInfo = sourceFile.getSourceRangeInfo(expression)
|
val expressionInfo = sourceFile.getSourceRangeInfo(expression)
|
||||||
var offset = receiver.endOffset - expressionInfo.startOffset + 1
|
var offset = receiver.endOffset - expressionInfo.startOffset + 1
|
||||||
if (receiver is IrConst<*> && receiver.kind == IrConstKind.String) offset++ // String constants don't include the quote
|
|
||||||
if (offset < 0 || offset >= source.length) return 0 // infix function called using non-infix syntax
|
if (offset < 0 || offset >= source.length) return 0 // infix function called using non-infix syntax
|
||||||
|
|
||||||
// Continue until there is a non-whitespace character
|
// Continue until there is a non-whitespace character
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// IGNORE_BACKEND_K1: JVM_IR
|
|
||||||
// IGNORE_BACKEND_K2: JVM_IR
|
|
||||||
// Disabled because of KT-65640
|
|
||||||
|
|
||||||
fun box() = expectThrowableMessage {
|
fun box() = expectThrowableMessage {
|
||||||
assert("Hello, World".matches("[A-Za-z]+".toRegex()))
|
assert("Hello, World".matches("[A-Za-z]+".toRegex()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// IGNORE_BACKEND_K1: JVM_IR
|
|
||||||
// IGNORE_BACKEND_K2: JVM_IR
|
|
||||||
// Disabled because of KT-65640
|
|
||||||
|
|
||||||
fun box() = expectThrowableMessage {
|
fun box() = expectThrowableMessage {
|
||||||
assert("Hello, World" matches "[A-Za-z]+".toRegex())
|
assert("Hello, World" matches "[A-Za-z]+".toRegex())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user