Test for KT-2082 Missing 'Unused expression' warning
#KT-2082 obsolete
This commit is contained in:
@@ -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
|
||||||
+6
@@ -729,6 +729,12 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
|
|||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/regression/ea65206.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/regression/ea65206.kt");
|
||||||
doTest(fileName);
|
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")
|
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/reified")
|
||||||
|
|||||||
Reference in New Issue
Block a user