Added tests for && and ||

This commit is contained in:
Mikhael Bogdanov
2013-12-02 12:43:51 +04:00
parent 0728428814
commit 712dcaac91
3 changed files with 25 additions and 1 deletions
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -TYPE_MISMATCH
inline fun inlineFunWithInvoke(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {
<!USAGE_IS_NOT_INLINABLE!>s<!> && <!USAGE_IS_NOT_INLINABLE!>ext<!>
<!USAGE_IS_NOT_INLINABLE!>s<!> || <!USAGE_IS_NOT_INLINABLE!>s<!>
}
inline fun inlineFunWithInvokeNonInline(noinline s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {
s && <!USAGE_IS_NOT_INLINABLE!>ext<!>
s || s
}
inline fun Function1<Int, Unit>.inlineExt() {
invoke(11)
<!USAGE_IS_NOT_INLINABLE!>this<!> && <!USAGE_IS_NOT_INLINABLE!>this<!>
<!USAGE_IS_NOT_INLINABLE!>this<!> || <!USAGE_IS_NOT_INLINABLE!>this<!>
}