Don't print descriptors' toString() in diagnostic messages

Use DescriptorRenderer.TEXT instead, it doesn't print the debug information
This commit is contained in:
Alexander Udalov
2014-04-08 23:34:11 +04:00
parent 5be2a4945b
commit adec89f74d
10 changed files with 75 additions and 6 deletions
@@ -0,0 +1,12 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: DIFFERENT_NAMES_FOR_THE_SAME_PARAMETER_IN_SUPERTYPES
trait A {
fun foo(x: Int)
}
trait B {
fun foo(y: Int) {}
}
class differentNamesForSameParameter : A, B
@@ -0,0 +1,2 @@
<!-- differentNamesForSameParameter1 -->
Names of the parameter #1 conflict in the following members of supertypes: 'internal abstract fun foo(x: kotlin.Int): kotlin.Unit defined in A, internal open fun foo(y: kotlin.Int): kotlin.Unit defined in B'. This may cause problems when calling this function with named arguments.
@@ -0,0 +1,8 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED
class extensionInClassReference {
fun Int.foo() {}
val bar = Int::foo
}
@@ -0,0 +1,2 @@
<!-- extensionInClassReference1 -->
'foo' is a member and an extension at the same time. References to such elements are not allowed
@@ -0,0 +1,12 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_WHEN_NO_EXPLICIT_OVERRIDE
trait C {
fun foo(x: Int = 42)
}
trait D {
fun foo(x: Int = 239) {}
}
class multipleDefaultsFromSupertypes : C, D
@@ -0,0 +1,2 @@
<!-- multipleDefaultsFromSupertypes1 -->
More than one overridden descriptor declares a default value for 'value-parameter val x: kotlin.Int = ... defined in multipleDefaultsFromSupertypes.foo'. As the compiler can not make sure these values agree, this is not allowed.
@@ -0,0 +1,8 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: UNUSED_VALUE
fun unusedValue(): Int {
var x: Int
x = 239
return 42
}
@@ -0,0 +1,2 @@
<!-- unusedValue1 -->
The value '239' assigned to 'var x: kotlin.Int defined in unusedValue' is never used