tests: Update external tests (1.1.2-dev-393)

This commit is contained in:
Ilya Matveev
2017-03-13 12:38:08 +03:00
committed by ilmat192
parent ac56fccb15
commit bc074e6d39
3178 changed files with 22396 additions and 696 deletions
@@ -0,0 +1,8 @@
fun <T: Number?> foo(t: T) {
(t ?: 42).toInt()
}
fun box(): String {
foo<Int?>(null)
return "OK"
}
@@ -0,0 +1,19 @@
interface PsiElement {
fun <T: PsiElement> findChildByType(i: Int): T? =
if (i == 42) JetOperationReferenceExpression() as T else throw Exception()
}
interface JetSimpleNameExpression : PsiElement {
fun getReferencedNameElement(): PsiElement
}
class JetOperationReferenceExpression : JetSimpleNameExpression {
override fun getReferencedNameElement() = this
}
class JetLabelReferenceExpression : JetSimpleNameExpression {
public override fun getReferencedNameElement(): PsiElement =
findChildByType(42) ?: this
}
fun box(): String {
val element = JetLabelReferenceExpression().getReferencedNameElement()
return if (element is JetOperationReferenceExpression) "OK" else "fail"
}
@@ -0,0 +1 @@
fun box() = null ?: null ?: "OK"
@@ -0,0 +1,6 @@
fun box(): String {
if ((42 ?: 239) != 42) return "Fail Int"
if ((42.toLong() ?: 239.toLong()) != 42.toLong()) return "Fail Long"
return "OK"
}