Test for KT-2082 Missing 'Unused expression' warning

#KT-2082 obsolete
This commit is contained in:
Evgeny Gerashchenko
2015-07-09 22:13:00 +03:00
parent 1cf433909b
commit 50dbf080f7
3 changed files with 21 additions and 0 deletions
@@ -0,0 +1,10 @@
fun foo(c : Collection<String>) = {
c.filter{
val s : String? = bar()
if (s == null) <!UNUSED_EXPRESSION!>false<!> // here!
zoo(<!TYPE_MISMATCH!>s<!>)
}
}
fun bar() : String? = null
fun zoo(<!UNUSED_PARAMETER!>s<!> : String) : Boolean = true
@@ -0,0 +1,5 @@
package
internal fun bar(): kotlin.String?
internal fun foo(/*0*/ c: kotlin.Collection<kotlin.String>): () -> kotlin.List<kotlin.String>
internal fun zoo(/*0*/ s: kotlin.String): kotlin.Boolean
@@ -729,6 +729,12 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/regression/ea65206.kt");
doTest(fileName);
}
@TestMetadata("kt2082.kt")
public void testKt2082() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/regression/kt2082.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/reified")