Files
kotlin-fork/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.kt
T
Dmitry Petrov 65f754ffca Fix KT-10764 IDEA doesn't show overload conflict between constructor and function...
When checking for overloads in package, consider functions and top-level class constructors as possibly conflicting between each other. NB OverloadUtil uses containing package scope from module descriptor.

Change diagnostic message for CONFLICTING_OVERLOAD: it's misleading in case of fun vs constructor conflict.

Add custom multifile test for diagnostics in IDE (probably not the best; should preprocess file content if it's required to check highlighting in multiple files, not only in the first file).

Add test for KT-10765 Incremental compilation misses overload conflict between constructor and function ...
2016-02-02 16:21:26 +03:00

69 lines
970 B
Kotlin
Vendored

// !DIAGNOSTICS: -DUPLICATE_CLASS_NAMES
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun ()<!> {
}
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun Outer.()<!> {
}
val<!SYNTAX!><!> : Int = 1
class<!SYNTAX!><!> {
}
object<!SYNTAX!><!> {
}
interface<!SYNTAX!><!> {
}
enum class<!SYNTAX!><!> {
}
annotation class<!SYNTAX!><!> <!ANNOTATION_CLASS_WITH_BODY!>{
}<!>
class Outer {
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun ()<!> {
}
<!REDECLARATION!>val<!SYNTAX!><!> : Int = 1<!>
<!REDECLARATION!>class<!SYNTAX!><!> {
}<!>
<!REDECLARATION!>object<!><!SYNTAX!><!> {
}
<!REDECLARATION!>interface<!SYNTAX!><!> {
}<!>
<!REDECLARATION!>enum class<!SYNTAX!><!> {
}<!>
<!REDECLARATION!>annotation class<!SYNTAX!><!> <!ANNOTATION_CLASS_WITH_BODY!>{
}<!><!>
}
fun outerFun() {
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun ()<!> {
}
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun ()<!> {
}
}