'operator' checks
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
operator fun compareTo(c: C): Int? = null
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun compareTo(c: C): Int? = null
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
|
||||
@@ -7,8 +7,8 @@ class event<T>()
|
||||
{
|
||||
val callbacks = ArrayList< Function1<T, Unit> >() // Should be ArrayList<()->Unit>, bug posted
|
||||
|
||||
operator fun plusAssign(f : (T) -> Unit) = callbacks.add(f)
|
||||
operator fun minusAssign(f : (T) -> Unit) = callbacks.remove(f)
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plusAssign(f : (T) -> Unit) = callbacks.add(f)
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun minusAssign(f : (T) -> Unit) = callbacks.remove(f)
|
||||
fun call(value : T) { for(c in callbacks) c(value) }
|
||||
}
|
||||
|
||||
@@ -32,4 +32,4 @@ class Test()
|
||||
control.MouseMoved <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>+=<!> { it.X } // here
|
||||
control.MouseMoved.plusAssign( { it.X } ) // ok
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user