Type parameter is not an expression: no need to report 'unused expression' on it

This commit is contained in:
Andrey Breslav
2013-12-02 22:41:43 +04:00
parent b5ae3adf77
commit ec39105183
4 changed files with 24 additions and 1 deletions
@@ -0,0 +1,15 @@
== foo ==
fun <T> foo() {
T
}
---------------------
L0:
<START> NEXT:[error(T, No resolved call)] PREV:[]
error(T, No resolved call) NEXT:[<END>] PREV:[<START>]
L1:
<END> NEXT:[<SINK>] PREV:[error(T, No resolved call)]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
=====================
+3
View File
@@ -0,0 +1,3 @@
fun <T> foo() {
T
}
@@ -2,7 +2,7 @@ package bar
class S<T> {
fun foo() {
<!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION, UNUSED_EXPRESSION!>T<!>
<!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION!>T<!>
<!TYPE_PARAMETER_ON_LHS_OF_DOT!>T<!>.<!UNRESOLVED_REFERENCE!>create<!>()
}
}
@@ -171,6 +171,11 @@ public class ControlFlowTestGenerated extends AbstractControlFlowTest {
doTest("compiler/testData/cfg/ShortFunction.kt");
}
@TestMetadata("typeParameter.kt")
public void testTypeParameter() throws Exception {
doTest("compiler/testData/cfg/typeParameter.kt");
}
@TestMetadata("unresolved.kt")
public void testUnresolved() throws Exception {
doTest("compiler/testData/cfg/unresolved.kt");