Exception fix: diagnose an error for a generic type which is a subtype of itself, a set of tests #EA-64453 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-06-01 19:34:50 +03:00
parent 46d5290f70
commit d77c6eb30e
12 changed files with 68 additions and 0 deletions
@@ -0,0 +1,3 @@
// !DIAGNOSTICS: -MUST_BE_INITIALIZED
fun <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T?<!>> foo() {}
val <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T?<!>> prop
@@ -0,0 +1,4 @@
package
internal val </*0*/ T : [ERROR : Cyclic upper bound: T?]> prop: [ERROR : No type, no body]
internal fun </*0*/ T : [ERROR : Cyclic upper bound: T?]> foo(): kotlin.Unit
@@ -0,0 +1,4 @@
fun bar() {
fun <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T?<!>> foo() {}
foo()
}
@@ -0,0 +1,3 @@
package
internal fun bar(): kotlin.Unit
@@ -0,0 +1,5 @@
// !DIAGNOSTICS: -MUST_BE_INITIALIZED_OR_BE_ABSTRACT
class My {
fun <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T?<!>> foo() {}
val <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T?<!>> prop: T
}
@@ -0,0 +1,10 @@
package
internal final class My {
public constructor My()
internal final val </*0*/ T : [ERROR : Cyclic upper bound: T?]> prop: [ERROR : ?]
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
internal final fun </*0*/ T : [ERROR : Cyclic upper bound: T?]> foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,3 @@
// !DIAGNOSTICS: -MUST_BE_INITIALIZED
fun <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T<!>> foo() {}
val <T: <!CYCLIC_GENERIC_UPPER_BOUND!>T?<!>> prop: T
@@ -0,0 +1,4 @@
package
internal val </*0*/ T : [ERROR : Cyclic upper bound: T?]> prop: [ERROR : ?]
internal fun </*0*/ T : [ERROR : Cyclic upper bound: T]> foo(): kotlin.Unit