Add failing test for smart-cast branch

This commit is contained in:
Mikhail Glukhikh
2019-08-23 12:16:35 +03:00
committed by Dmitriy Novozhilov
parent b4a4d4d709
commit b1731749c0
2 changed files with 16 additions and 0 deletions
@@ -0,0 +1,11 @@
inline fun <K, V, VA : V> MutableMap<K, V>.getOrPut(key: K, defaultValue: (K) -> VA, postCompute: (VA) -> Unit): V {
val value = get(key)
return if (value == null) {
val answer = defaultValue(key)
put(key, answer)
postCompute(answer)
answer
} else {
value
}
}
@@ -134,6 +134,11 @@ public class FirResolveTestCaseWithStdlibGenerated extends AbstractFirResolveTes
runTest("compiler/fir/resolve/testData/resolve/stdlib/typeAliasDeserialization.kt");
}
@TestMetadata("typeParameterDerived.kt")
public void testTypeParameterDerived() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/typeParameterDerived.kt");
}
@TestMetadata("unaryOperators.kt")
public void testUnaryOperators() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/unaryOperators.kt");