More accurate CFG for local class constructors (now they are not considered unconditionally executed) #KT-10042 Fixed
This commit is contained in:
Vendored
+1
-1
@@ -23,7 +23,7 @@ fun testObjectExpression1() {
|
||||
fun testClassDeclaration() {
|
||||
class C : <!UNREACHABLE_CODE!>Foo(<!>todo()<!UNREACHABLE_CODE!>)<!> {}
|
||||
|
||||
<!UNREACHABLE_CODE!>bar()<!>
|
||||
bar()
|
||||
}
|
||||
|
||||
fun testFunctionDefaultArgument() {
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
fun foo() {
|
||||
var x: String
|
||||
class A {
|
||||
init {
|
||||
x = ""
|
||||
}
|
||||
}
|
||||
// Error! See KT-10042
|
||||
<!UNINITIALIZED_VARIABLE!>x<!>.length
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
var x: String
|
||||
object: Any() {
|
||||
init {
|
||||
x = ""
|
||||
}
|
||||
}
|
||||
// Ok
|
||||
x.length
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
public fun bar(): kotlin.Unit
|
||||
public fun foo(): kotlin.Unit
|
||||
Reference in New Issue
Block a user