Fix variable name validator (take parameters into account)
This commit is contained in:
@@ -119,7 +119,7 @@ class NewDeclarationNameValidator(
|
||||
if (nameAsName != name) return false
|
||||
if (this is KtCallableDeclaration && receiverTypeReference != null) return false
|
||||
return when(target) {
|
||||
Target.VARIABLES -> this is KtVariableDeclaration
|
||||
Target.VARIABLES -> this is KtVariableDeclaration || this is KtParameter
|
||||
Target.FUNCTIONS_AND_CLASSES -> this is KtNamedFunction || this is KtClassOrObject || this is KtTypeAlias
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,9 +31,9 @@ fun baz(f: (Int, Boolean) -> String) {
|
||||
class Baz1(f: (Int, Boolean) -> String) : Foo({ i -> f(i, this) })
|
||||
class Baz2 : Foo({ i -> (::g)(i, this) })
|
||||
|
||||
val f = lambda()
|
||||
val f1 = lambda()
|
||||
|
||||
class Baz3 : Foo({ i -> f(i, this) })
|
||||
class Baz3 : Foo({ i -> f1(i, this) })
|
||||
class Baz4 : Foo({ i -> "${i + 1} ${this}" })
|
||||
|
||||
class Baz5 : Foo {
|
||||
|
||||
+2
-2
@@ -31,9 +31,9 @@ fun baz(f: (Int, Boolean) -> String) {
|
||||
class Baz1(f: (Int, Boolean) -> String) : Foo({ i -> f(i, this) })
|
||||
class Baz2 : Foo({ i -> (::g)(i, this) })
|
||||
|
||||
val f = lambda()
|
||||
val f1 = lambda()
|
||||
|
||||
class Baz3 : Foo({ i -> f(i, this) })
|
||||
class Baz3 : Foo({ i -> f1(i, this) })
|
||||
class Baz4 : Foo({ i -> "${i + 1} ${this}" })
|
||||
|
||||
class Baz5 : Foo {
|
||||
|
||||
Reference in New Issue
Block a user