Conform functions to extension functions and vice versa

#KT-5989 Fixed
This commit is contained in:
Alexander Udalov
2015-04-30 20:55:38 +03:00
parent b08bd3bc67
commit 49004a8b8e
44 changed files with 299 additions and 226 deletions
@@ -12,14 +12,14 @@ inline fun <T, U> Function1<T, U>.plusAssign(p: Function1<T, U>) {
<!USAGE_IS_NOT_INLINABLE!>p<!> -= <!USAGE_IS_NOT_INLINABLE!>this<!>
}
fun <T, U, V> ExtensionFunction1<T, U, V>.minusAssign(ext : ExtensionFunction1<T, U, V>) {}
fun <T, U, V> @extension Function2<T, U, V>.minusAssign(ext : @extension Function2<T, U, V>) {}
inline fun <T, U, V> ExtensionFunction1<T, U, V>.modAssign(ext : ExtensionFunction1<T, U, V>) = {
inline fun <T, U, V> @extension Function2<T, U, V>.modAssign(ext : @extension Function2<T, U, V>) = {
this += ext
ext += this
}
inline fun <T, U, V> ExtensionFunction1<T, U, V>.plusAssign(ext : ExtensionFunction1<T, U, V>) {
inline fun <T, U, V> @extension Function2<T, U, V>.plusAssign(ext : @extension Function2<T, U, V>) {
<!USAGE_IS_NOT_INLINABLE!>this<!> -= <!USAGE_IS_NOT_INLINABLE!>ext<!>
<!USAGE_IS_NOT_INLINABLE!>ext<!> -= <!USAGE_IS_NOT_INLINABLE!>this<!>
}
@@ -27,4 +27,4 @@ inline fun <T, U, V> ExtensionFunction1<T, U, V>.plusAssign(ext : ExtensionFunct
inline fun <T, U, V> inlineFunWithInvoke(s: (p: T) -> U, ext: T.(p: U) -> V) {
s += s
ext += ext
}
}