Fix common misspellings

This commit is contained in:
Marcin Moskala
2018-11-25 23:35:33 +03:00
committed by Nikolay Krasko
parent 33961acb8d
commit 686cfa6fd2
58 changed files with 115 additions and 123 deletions
@@ -111,7 +111,7 @@ fun outerFinallyInitializes() {
// Definite reassignment here, cause can get here only if myRun finished
x = outerComputation()
} catch (e: java.lang.Exception) {
// can catch exception thrown by the inner, so x can be not initalized
// can catch exception thrown by the inner, so x can be not initialized
log()
} finally {
// Possible reassignment (e.g. if everything finished)
@@ -123,10 +123,10 @@ fun outerFinallyInitializes() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() })
v(val x: Int) INIT: in: {} out: {x=D}
mark(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=D} out: {x=D}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() })
v(val x: Int) INIT: in: {} out: {x=D}
mark(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=D} out: {x=D}
jmp?(L2)
jmp?(L3)
3 mark({ myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() })
@@ -135,7 +135,7 @@ L0:
mark(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 })
call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|<v0>) -> <v1>
L4 [before inlined declaration]:
inlined({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) INIT: in: {x=ID} out: {x=ID}
inlined({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) INIT: in: {x=ID} out: {x=ID}
L5 [after inlined declaration]:
mark(outerComputation())
call(outerComputation(), outerComputation) -> <v2>
@@ -144,38 +144,38 @@ L5 [after inlined declaration]:
jmp?(L3)
jmp(L10)
L2 [onException]:
3 v(e: java.lang.Exception) INIT: in: {x=I?D} out: {x=I?D}
magic[FAKE_INITIALIZER](e: java.lang.Exception) -> <v4> INIT: in: {x=I?D} out: {x=I?D}
w(e|<v4>) INIT: in: {x=I?D} out: {x=I?D}
4 mark({ // can catch exception thrown by the inner, so x can be not initalized log() }) INIT: in: {x=I?D} out: {x=I?D}
3 v(e: java.lang.Exception) INIT: in: {x=I?D} out: {x=I?D}
magic[FAKE_INITIALIZER](e: java.lang.Exception) -> <v4> INIT: in: {x=I?D} out: {x=I?D}
w(e|<v4>) INIT: in: {x=I?D} out: {x=I?D}
4 mark({ // can catch exception thrown by the inner, so x can be not initialized log() }) INIT: in: {x=I?D} out: {x=I?D}
mark(log())
call(log(), log) -> <v5>
3 jmp(L10)
L10 [afterCatches]:
2 jmp(L11) USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
2 jmp(L11) USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
L3 [onExceptionToFinallyBlock]:
L12 [start finally]:
3 mark({ // Possible reassignment (e.g. if everything finished) x = 42 })
r(42) -> <v6> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ}
w(x|<v6>) INIT: in: {x=I?D} out: {x=ID} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ}
r(42) -> <v6> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ}
w(x|<v6>) INIT: in: {x=I?D} out: {x=ID} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ}
L13 [finish finally]:
2 jmp(error) INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
2 jmp(error) INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
L11 [skipFinallyToErrorBlock]:
L14 [copy of L3, onExceptionToFinallyBlock]:
3 mark({ // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=I?D} out: {x=I?D}
r(42) -> <v6> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v6>) INIT: in: {x=I?D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ}
2 merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!<v3>, <v5>) -> <v8> INIT: in: {x=ID} out: {x=ID}
mark(x.inc()) USE: in: {x=READ} out: {x=READ}
r(x) -> <v9> USE: in: {} out: {x=READ}
3 mark({ // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=I?D} out: {x=I?D}
r(42) -> <v6> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v6>) INIT: in: {x=I?D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ}
2 merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!<v3>, <v5>) -> <v8> INIT: in: {x=ID} out: {x=ID}
mark(x.inc()) USE: in: {x=READ} out: {x=READ}
r(x) -> <v9> USE: in: {} out: {x=READ}
mark(inc())
call(inc(), inc|<v9>) -> <v10>
L1:
1 <END> INIT: in: {} out: {}
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== inlined anonymous_1 ==
{
@@ -32,7 +32,7 @@ fun outerFinallyInitializes() {
// Definite reassignment here, cause can get here only if myRun finished
x = outerComputation()
} catch (e: java.lang.Exception) {
// can catch exception thrown by the inner, so x can be not initalized
// can catch exception thrown by the inner, so x can be not initialized
log()
} finally {
// Possible reassignment (e.g. if everything finished)
@@ -59,7 +59,7 @@ fun outerFinallyInitializes() {
// Definite reassignment here, cause can get here only if myRun finished
x = outerComputation()
} catch (e: java.lang.Exception) {
// can catch exception thrown by the inner, so x can be not initalized
// can catch exception thrown by the inner, so x can be not initialized
log()
} finally {
// Possible reassignment (e.g. if everything finished)
@@ -70,22 +70,22 @@ fun outerFinallyInitializes() {
x.inc()
}
---------------------
<v4>: {<: Exception} NEW: magic[FAKE_INITIALIZER](e: java.lang.Exception) -> <v4>
{ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v0>: {<: () -> Unit} NEW: r({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) -> <v0>
myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v1>: * NEW: call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|<v0>) -> <v1>
outerComputation() <v2>: Int NEW: call(outerComputation(), outerComputation) -> <v2>
x = outerComputation() !<v3>: *
{ myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } !<v3>: * COPY
log() <v5>: * NEW: call(log(), log) -> <v5>
{ // can catch exception thrown by the inner, so x can be not initalized log() } <v5>: * COPY
42 <v6>: Int NEW: r(42) -> <v6>
x = 42 !<v7>: *
{ // Possible reassignment (e.g. if everything finished) x = 42 } !<v7>: * COPY
try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } <v8>: * NEW: merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!<v3>, <v5>) -> <v8>
x <v9>: Int NEW: r(x) -> <v9>
inc() <v10>: * NEW: call(inc(), inc|<v9>) -> <v10>
x.inc() <v10>: * COPY
{ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() } <v10>: * COPY
<v4>: {<: Exception} NEW: magic[FAKE_INITIALIZER](e: java.lang.Exception) -> <v4>
{ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v0>: {<: () -> Unit} NEW: r({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) -> <v0>
myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v1>: * NEW: call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|<v0>) -> <v1>
outerComputation() <v2>: Int NEW: call(outerComputation(), outerComputation) -> <v2>
x = outerComputation() !<v3>: *
{ myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } !<v3>: * COPY
log() <v5>: * NEW: call(log(), log) -> <v5>
{ // can catch exception thrown by the inner, so x can be not initialized log() } <v5>: * COPY
42 <v6>: Int NEW: r(42) -> <v6>
x = 42 !<v7>: *
{ // Possible reassignment (e.g. if everything finished) x = 42 } !<v7>: * COPY
try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } <v8>: * NEW: merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!<v3>, <v5>) -> <v8>
x <v9>: Int NEW: r(x) -> <v9>
inc() <v10>: * NEW: call(inc(), inc|<v9>) -> <v10>
x.inc() <v10>: * COPY
{ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() } <v10>: * COPY
=====================
== inlined anonymous_1 ==
{
@@ -142,7 +142,7 @@ fun threeLayersReturn(x: Int?): Int? {
// Inner always jumps to outer
// And middle always calls inner
// So, in fact, middle never finished normally
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization
// Hence, outer doesn't performs definite initialization
val y: Int
myRun outer@ {
@@ -167,7 +167,7 @@ L0:
v(x: Int?)
magic[FAKE_INITIALIZER](x: Int?) -> <v0>
w(x|<v0>)
2 mark({ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() })
2 mark({ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() })
v(val y: Int)
mark(outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 })
mark({ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 })
@@ -183,11 +183,11 @@ L3 [after inlined declaration]:
call(inc(), inc|<v3>) -> <v4>
ret(*|<v4>) L1
L1:
1 <END> NEXT:[<SINK>]
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
<SINK> PREV:[<ERROR>, <END>]
=====================
== inlined anonymous_2 ==
{
@@ -25,7 +25,7 @@ fun threeLayersReturn(x: Int?): Int? {
// Inner always jumps to outer
// And middle always calls inner
// So, in fact, middle never finished normally
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization
// Hence, outer doesn't performs definite initialization
val y: Int
myRun outer@ {
@@ -72,7 +72,7 @@ fun threeLayersReturn(x: Int?): Int? {
// Inner always jumps to outer
// And middle always calls inner
// So, in fact, middle never finished normally
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization
// Hence, outer doesn't performs definite initialization
val y: Int
myRun outer@ {
@@ -92,15 +92,15 @@ fun threeLayersReturn(x: Int?): Int? {
return y.inc()
}
---------------------
<v0>: {<: Int?} NEW: magic[FAKE_INITIALIZER](x: Int?) -> <v0>
{ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> Unit} NEW: r({ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }) -> <v1>
outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> Unit} COPY
myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v2>: * NEW: call(myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }, myRun|<v1>) -> <v2>
y <v3>: Int NEW: r(y) -> <v3>
inc() <v4>: {<: Int?} NEW: call(inc(), inc|<v3>) -> <v4>
y.inc() <v4>: {<: Int?} COPY
return y.inc() !<v5>: *
{ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() } !<v5>: * COPY
<v0>: {<: Int?} NEW: magic[FAKE_INITIALIZER](x: Int?) -> <v0>
{ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> Unit} NEW: r({ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }) -> <v1>
outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> Unit} COPY
myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v2>: * NEW: call(myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }, myRun|<v1>) -> <v2>
y <v3>: Int NEW: r(y) -> <v3>
inc() <v4>: {<: Int?} NEW: call(inc(), inc|<v3>) -> <v4>
y.inc() <v4>: {<: Int?} COPY
return y.inc() !<v5>: *
{ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() } !<v5>: * COPY
=====================
== inlined anonymous_2 ==
{
+1 -1
View File
@@ -1,7 +1,7 @@
inline fun a(l: () -> Unit) {
b(l)
//check taht nested not recognized as cycle
//check that nested not recognized as cycle
c {
c {
+1 -1
View File
@@ -1,7 +1,7 @@
inline fun a(l: () -> Unit) {
b(l)
//check taht nested not recognized as cycle
//check that nested not recognized as cycle
c {
c {
@@ -1,4 +1,4 @@
// dummy test of syntax error highlighing in tests
// dummy test of syntax error highlighting in tests
fun get() {
1 + 2 <!SYNTAX!>2 3 4<!>
@@ -11,7 +11,7 @@ public class C {
open fun m() {}
}
// Note that Data is resolved succesfully here because we don't step on error-scope
// Note that Data is resolved successfully here because we don't step on error-scope
val data: Data = Data()
companion <!CYCLIC_SCOPES_WITH_COMPANION!>object<!> : DerivedAbstract() {
@@ -50,7 +50,7 @@ object WithPropertyInBaseDifferentOrder {
class Data
public class C {
// Now it is succesfully resolved (vs. ErrorType like in the previous case)
// Now it is successfully resolved (vs. ErrorType like in the previous case)
val data: Data = Data()
open class <!CYCLIC_SCOPES_WITH_COMPANION!>Base<!>() {
@@ -3,7 +3,7 @@ enum class A(val c: Int) {
ONE(1),
TWO(2),
THREE(3),
FOURTY_TWO();
FORTY_TWO();
var last: A? = null
@@ -7,7 +7,7 @@ public final enum class A : kotlin.Enum<A> {
enum entry THREE
enum entry FOURTY_TWO
enum entry FORTY_TWO
private constructor A()
private constructor A(/*0*/ c: kotlin.Int)
@@ -3,7 +3,7 @@ enum class A(val c: Int) {
ONE(1),
TWO(2),
THREE(3),
FOURTY_TWO();
FORTY_TWO();
constructor(): this(42)
}
@@ -7,7 +7,7 @@ public final enum class A : kotlin.Enum<A> {
enum entry THREE
enum entry FOURTY_TWO
enum entry FORTY_TWO
private constructor A()
private constructor A(/*0*/ c: kotlin.Int)
@@ -21,7 +21,7 @@ class Outer<E> {
fun factoryString(): Outer<String>.Inner<String> = null!!
fun <T, Y> infer(x: T, y: Y): Outer<T>.Inner<Y> = null!!
val infered = infer("", 1)
val inferred = infer("", 1)
fun main() {
val outer = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner<kotlin.Int>
public val inferred: Outer<kotlin.String>.Inner<kotlin.Int>
public fun factoryString(): Outer<kotlin.String>.Inner<kotlin.String>
public fun </*0*/ T, /*1*/ Y> infer(/*0*/ x: T, /*1*/ y: Y): Outer<T>.Inner<Y>
public fun main(): kotlin.Unit
@@ -15,7 +15,7 @@ class Outer<E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -15,7 +15,7 @@ class Outer<in E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer = Outer<CharSequence>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -16,7 +16,7 @@ class Outer<out E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -16,7 +16,7 @@ class Outer<E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer: Outer<out String> = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -4,6 +4,6 @@ val test1f: suspend () -> Unit = <!TYPE_MISMATCH!>fun () {}<!>
val test2f: suspend Any.() -> Unit = <!TYPE_MISMATCH!>fun Any.() {}<!>
// This is a bug in the old inference and should be fixed in new inference
// see "Fix anonymous function literals handling in type checker" for more deatils
// see "Fix anonymous function literals handling in type checker" for more details
val test3f: suspend Any.(Int) -> Int = <!TYPE_MISMATCH!>fun (k: Int) = k + 1<!>
val test4f: SuspendFn = <!TYPE_MISMATCH!>fun Any.() {}<!>
@@ -26,7 +26,7 @@ fun threeLevelsReturnNoInitialization(x: Int?): Int? {
// Inner always jumps to outer
// And middle always calls inner
// So, in fact, middle never finished normally
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization
// Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization
// Hence, outer doesn't performs definite initialization
val y: Int
myRun outer@ {
@@ -35,7 +35,7 @@ fun outerFinallyInitializes() {
// Not reported because of repeating diagnostic
x = outerComputation()
} catch (e: java.lang.Exception) {
// can catch exception thrown by the inner, so x can be not initalized
// can catch exception thrown by the inner, so x can be not initialized
<!UNINITIALIZED_VARIABLE!>x<!>.inc()
log()
} finally {
@@ -85,7 +85,7 @@ fun testTakeUnless(x: Int?) {
fun testRepeatOnVal(x: Int) {
val y: Int
repeat(x) {
// reassignment instead of captured val initalization
// reassignment instead of captured val initialization
<!VAL_REASSIGNMENT!>y<!> = 42
}
println(<!UNINITIALIZED_VARIABLE!>y<!>)