Fix double quotes in diagnostic messages

For diagnostics without any parameters, the given text is simply rendered as a
String, so no symbols should be escaped.

For diagnostics with parameters, the format in java.text.MessageFormat is used,
so one single quote is erased and two single quotes become one single quote in
the rendered text.
This commit is contained in:
Alexander Udalov
2016-03-29 14:13:59 +03:00
parent 484167e9d9
commit 8316953259
41 changed files with 103 additions and 103 deletions
@@ -1,6 +1,6 @@
// FILE: first.before.kt
// "Import" "true"
// ERROR: operator modifier is required on 'get' in 'some.Some'
// ERROR: 'operator' modifier is required on 'get' in 'some.Some'
package testing
@@ -27,7 +27,7 @@ operator fun Some.get(s: String) {}
// FILE: first.after.kt
// "Import" "true"
// ERROR: operator modifier is required on 'get' in 'some.Some'
// ERROR: 'operator' modifier is required on 'get' in 'some.Some'
package testing
@@ -1,6 +1,6 @@
// FILE: first.before.kt
// "Import" "true"
// ERROR: operator modifier is required on 'set' in 'some.Some'
// ERROR: 'operator' modifier is required on 'set' in 'some.Some'
package testing
@@ -27,7 +27,7 @@ operator fun Some.set(s: String, i: Int) {}
// FILE: first.after.kt
// "Import" "true"
// ERROR: operator modifier is required on 'set' in 'some.Some'
// ERROR: 'operator' modifier is required on 'set' in 'some.Some'
package testing
+3 -3
View File
@@ -1,6 +1,6 @@
// FILE: first.before.kt
// "Import" "true"
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found
package testing
@@ -14,7 +14,7 @@ fun testing() {
// FILE: second.kt
// "Import" "true"
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found
package some
@@ -26,7 +26,7 @@ operator fun Some.invoke(s: String) {}
// FILE: first.after.kt
// "Import" "true"
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found
package testing
@@ -1,6 +1,6 @@
// FILE: first.before.kt
// "Import" "false"
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found
// ACTION: Create extension function 'invoke'
// ACTION: Create member function 'invoke'
@@ -17,7 +17,7 @@ fun testing() {
// FILE: second.kt
// "Import" "true"
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found
package some
@@ -29,7 +29,7 @@ fun Some.invoke(s: String) {}
// FILE: first.after.kt
// "Import" "true"
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found
// ACTION: Create extension function 'invoke'
// ACTION: Create member function 'invoke'
@@ -1,6 +1,6 @@
// "Add non-null asserted (!!) call" "false"
// ACTION: Replace with a 'forEach' function call
// ERROR: Not nullable value required to call an iterator() method on for-loop range
// ERROR: Not nullable value required to call an 'iterator()' method on for-loop range
class Some {
fun iterator(): Iterator<Int> = null!!
@@ -1,5 +1,5 @@
// "Add 'operator' modifier" "true"
// ERROR: operator modifier is required on 'component2' in 'A'
// ERROR: 'operator' modifier is required on 'component2' in 'A'
class A {
fun component1(): Int = 0
@@ -1,5 +1,5 @@
// "Add 'operator' modifier" "true"
// ERROR: operator modifier is required on 'component2' in 'A'
// ERROR: 'operator' modifier is required on 'component2' in 'A'
class A {
operator fun component1(): Int = 0
@@ -1,5 +1,5 @@
// "Make <set-prop> internal" "true"
// ERROR: Cannot assign to 'prop': the setter is 'private' in file
// ERROR: Cannot assign to 'prop': the setter is private in file
package test
@@ -1,5 +1,5 @@
// "Make <set-prop> internal" "true"
// ERROR: Cannot assign to 'prop': the setter is 'private' in file
// ERROR: Cannot assign to 'prop': the setter is private in file
package test
@@ -1,5 +1,5 @@
// "Change to property access" "false"
// ERROR: Expression 'fd' of type 'String' cannot be invoked as a function. The function invoke() is not found
// ERROR: Expression 'fd' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found
class A(val fd: String)
fun x() {