"Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors

This commit is contained in:
Yan Zhulanow
2015-12-25 18:35:02 +03:00
parent f560799bb7
commit 3fa506fd45
67 changed files with 56 additions and 347 deletions
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
test.contai<caret>ns(1)
}
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
1 in test
}
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(c: Int, vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
test.contai<caret>ns(1)
}
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(c: Int, vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
1 in test
}
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(a: Int, b: Int=5) : Boolean = true
}
val test = Test()
test.c<caret>ontains(1)
}
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(a: Int, b: Int=5) : Boolean = true
}
val test = Test()
1 in test
}
@@ -1,5 +1,6 @@
// IS_APPLICABLE: false
// ERROR: Cannot find a parameter with this name: c
// ERROR: operator modifier is inapplicable on this function: must have a single value parameter
fun test() {
class Test{
operator fun contains(a: Int=1, b: Int=2): Boolean = true
@@ -1,5 +1,6 @@
// IS_APPLICABLE: false
// ERROR: No value passed for parameter b
// ERROR: operator modifier is inapplicable on this function: must have a single value parameter
fun test() {
class Test{
operator fun contains(a: Int, b: Int): Boolean = true
@@ -1,4 +1,5 @@
// IS_APPLICABLE: false
// ERROR: operator modifier is inapplicable on this function: must have a single value parameter
fun test() {
class Test{
operator fun contains(a: Int=1, b: Int=2) : Boolean = true
@@ -1,4 +1,5 @@
// IS_APPLICABLE: false
// ERROR: operator modifier is inapplicable on this function: must have a single value parameter
fun test() {
class Test{
operator fun contains(a: Int, b: Int) : Boolean = true
@@ -1,4 +1,5 @@
// IS_APPLICABLE: false
// ERROR: operator modifier is inapplicable on this function: must have a single value parameter
fun test() {
class Test{
operator fun contains(vararg b: Int, c: Int = 0): Boolean = true
@@ -1,4 +1,5 @@
// IS_APPLICABLE: false
// ERROR: operator modifier is inapplicable on this function: must have a single value parameter
fun test() {
class Test{
operator fun contains(vararg b: Int, c: Int = 0): Boolean = true
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(a: Int=1, b: Int=2) : Boolean = true
}
val test = Test()
test.c<caret>ontains(a=5)
}
@@ -1,7 +0,0 @@
fun test() {
class Test{
operator fun contains(a: Int=1, b: Int=2) : Boolean = true
}
val test = Test()
5 in test
}