Report error when type parameter has a type parameter bound and any other bound

To prevent issues with erasure on JVM: it's unclear what such type parameter
should be erased to
This commit is contained in:
Alexander Udalov
2015-11-30 22:50:20 +03:00
parent b1fa740341
commit d3c17ec337
17 changed files with 98 additions and 69 deletions
@@ -34,7 +34,7 @@ fun test4() {
//--------------
fun <T: A, R> emptyStrangeMap2(t: T): Map<T, R> where R: T, R: A = throw Exception("$t")
fun <T: A, R> emptyStrangeMap2(t: T): Map<T, R> where R: T = throw Exception("$t")
fun test5(a: A) {
emptyStrangeMap2(a)
@@ -5,7 +5,7 @@ package a {
public fun </*0*/ T : a.A> emptyListOfA(): kotlin.List<T>
public fun </*0*/ T : a.A, /*1*/ R : T> emptyStrangeMap(): kotlin.Map<T, R>
public fun </*0*/ T, /*1*/ R : T> emptyStrangeMap1(/*0*/ t: T): kotlin.Map<T, R>
public fun </*0*/ T : a.A, /*1*/ R : T> emptyStrangeMap2(/*0*/ t: T): kotlin.Map<T, R> where R : a.A
public fun </*0*/ T : a.A, /*1*/ R : T> emptyStrangeMap2(/*0*/ t: T): kotlin.Map<T, R>
public fun </*0*/ T : a.A, /*1*/ R : T> emptyStrangeMap3(/*0*/ r: R): kotlin.Map<T, R>
public fun </*0*/ T, /*1*/ R : T> emptyStrangeMap4(/*0*/ l: kotlin.MutableList<T>): kotlin.Map<T, R>
public fun </*0*/ U, /*1*/ V : U> foo(): U