added tests for specific type inference errors

This commit is contained in:
Svetlana Isakova
2012-07-18 14:44:52 +04:00
parent 4d281a40c8
commit e3d2b013da
3 changed files with 46 additions and 0 deletions
@@ -0,0 +1,19 @@
package conflictingSubstitutions
//+JDK
import java.util.*
fun <R> elemAndList(r: R, <!UNUSED_PARAMETER!>t<!>: List<R>): R = r
fun <R> R.elemAndListWithReceiver(r: R, <!UNUSED_PARAMETER!>t<!>: List<R>): R = r
fun test() {
val <!UNUSED_VARIABLE!>s<!> = <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>elemAndList<!>(11, list("72"))
val <!UNUSED_VARIABLE!>u<!> = 11.<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>elemAndListWithReceiver<!>(4, list("7"))
}
fun list<T>(value: T) : ArrayList<T> {
val list = ArrayList<T>()
list.add(value)
return list
}