Files
kotlin/compiler/testData/diagnostics/tests/DefaultValuesCheckWithoutBody.kt
Denis Zharkov 527daced46 Optimize CFG for cases of simple variables
Parameters/vals with an immediate initializer (which we assume is a
rather common situation) do not require any kind of complicated CFA

- Unused vals can be simply determined by linear traversal of
  the pseudocode
- Definite assignment is a bit more complicated: a read-instruction of val
  can be considered as a safe if it's located *after* the first write in
  the pseudocode. It works almost always beside the case with do/while
  (see the test changed). This case will be fixed in the further commits

The test for kt897.kt will also be fixed further, all other changes
might be considered as minor as they mostly change diagnostics for
already red code
2017-10-02 10:04:16 +03:00

10 lines
315 B
Kotlin
Vendored

interface Inter {
fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int = x)
}
abstract class Abst {
abstract fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int = x)
}
<!NON_MEMBER_FUNCTION_NO_BODY!>fun extraDiagnostics(<!UNUSED_PARAMETER!>x<!>: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int)<!>