drop deprecated syntax for anonymous initializer blocks
This commit is contained in:
@@ -32,7 +32,7 @@ fun main(args : Array<String>) {
|
||||
<!UNRESOLVED_REFERENCE!>a<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>foo1<!>()(<!UNRESOLVED_REFERENCE!>a<!>)
|
||||
|
||||
foo2()({})
|
||||
foo2()<!TOO_MANY_ARGUMENTS, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
|
||||
foo2()<!TOO_MANY_ARGUMENTS!>{}<!>
|
||||
(foo2()){}
|
||||
(foo2()){<!EXPECTED_PARAMETERS_NUMBER_MISMATCH, CANNOT_INFER_PARAMETER_TYPE!>x<!> -> }
|
||||
foo2()({<!EXPECTED_PARAMETERS_NUMBER_MISMATCH, CANNOT_INFER_PARAMETER_TYPE!>x<!> -> })
|
||||
|
||||
@@ -12,6 +12,6 @@ fun test() {
|
||||
v1({}, {})
|
||||
v1({}, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, {})
|
||||
v1({}, {}, {<!UNUSED_EXPRESSION!>it<!>})
|
||||
v1({}) <!VARARG_OUTSIDE_PARENTHESES, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
|
||||
v1 <!VARARG_OUTSIDE_PARENTHESES, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
|
||||
v1({}) <!VARARG_OUTSIDE_PARENTHESES!>{}<!>
|
||||
v1 <!VARARG_OUTSIDE_PARENTHESES!>{}<!>
|
||||
}
|
||||
@@ -10,7 +10,7 @@ fun test() {
|
||||
|
||||
bar(<!UNRESOLVED_REFERENCE, TOO_MANY_ARGUMENTS!>xx<!>)
|
||||
|
||||
bar <!TOO_MANY_ARGUMENTS, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{ }<!>
|
||||
bar <!TOO_MANY_ARGUMENTS!>{ }<!>
|
||||
|
||||
foo(<!TYPE_MISMATCH!>""<!>, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, <!UNRESOLVED_REFERENCE, TOO_MANY_ARGUMENTS!>xx<!>)
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
class Foo() {
|
||||
private val builder = StringBuilder("sdfsd")
|
||||
|
||||
init {
|
||||
}
|
||||
}
|
||||
|
||||
class Foo1() {
|
||||
private val builder = <!NONE_APPLICABLE!>StringBuilder<!>("sdfsd")
|
||||
|
||||
<!DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun foo() = {
|
||||
<!NONE_APPLICABLE!>println<!>(1)
|
||||
<!DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
|
||||
}
|
||||
|
||||
fun foo1() = {
|
||||
println(1);
|
||||
{}
|
||||
}
|
||||
|
||||
fun println(<!UNUSED_PARAMETER!>i<!> : Int) {}
|
||||
fun println(<!UNUSED_PARAMETER!>s<!> : Byte) {}
|
||||
fun println() {}
|
||||
@@ -1,26 +0,0 @@
|
||||
package
|
||||
|
||||
internal fun foo(): () -> ???
|
||||
internal fun foo1(): () -> () -> kotlin.Unit
|
||||
internal fun println(): kotlin.Unit
|
||||
internal fun println(/*0*/ s: kotlin.Byte): kotlin.Unit
|
||||
internal fun println(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
|
||||
internal final class Foo {
|
||||
public constructor Foo()
|
||||
private final val builder: java.lang.StringBuilder
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class Foo1 {
|
||||
public constructor Foo1()
|
||||
private final val builder: [ERROR : Type for StringBuilder("sdfsd")
|
||||
|
||||
{
|
||||
}]
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package baz
|
||||
|
||||
fun test() {
|
||||
<!NONE_APPLICABLE!>foo<!>(1) <!DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
|
||||
|
||||
foo( <!NONE_APPLICABLE!>foo<!>(1) {} ) //here
|
||||
}
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>i<!>: Int) {}
|
||||
|
||||
fun foo() : (i : () -> Unit) -> Unit = {}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package
|
||||
|
||||
package baz {
|
||||
internal fun foo(): (() -> kotlin.Unit) -> kotlin.Unit
|
||||
internal fun foo(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
internal fun test(): kotlin.Unit
|
||||
}
|
||||
@@ -7,4 +7,4 @@ object Obj {
|
||||
}
|
||||
}
|
||||
|
||||
val x = Obj.method<!TOO_MANY_ARGUMENTS, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{ -> }<!>
|
||||
val x = Obj.method<!TOO_MANY_ARGUMENTS!>{ -> }<!>
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
class A {
|
||||
val x: Int
|
||||
val y: Int
|
||||
<!INIT_KEYWORD_BEFORE_CLASS_INITIALIZER_EXPECTED!>{<!>
|
||||
x = 1
|
||||
}
|
||||
init {
|
||||
y = 1
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final val x: kotlin.Int
|
||||
internal final val y: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
|
||||
{
|
||||
init {
|
||||
foo()
|
||||
val c = f
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ JetFile: AnonymousInitializer.kt
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiElement(init)('init')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
|
||||
@@ -3,13 +3,13 @@ class Foo() {
|
||||
var b : Int get() = 1; set
|
||||
var b1 : Int get() = 1; set {1}
|
||||
val b2 : Int get
|
||||
{
|
||||
init {
|
||||
|
||||
}
|
||||
val b3 : Int get {
|
||||
return 1
|
||||
}
|
||||
val b4 : Int get; {
|
||||
val b4 : Int get; init {
|
||||
}
|
||||
|
||||
var b5 : Int get abstract set
|
||||
|
||||
@@ -123,6 +123,8 @@ JetFile: PropertiesFollowedByInitializers.kt
|
||||
PsiElement(get)('get')
|
||||
PsiWhiteSpace('\n ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiElement(init)('init')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
@@ -177,6 +179,8 @@ JetFile: PropertiesFollowedByInitializers.kt
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace(' ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiElement(init)('init')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
|
||||
@@ -17,7 +17,7 @@ class Foo {
|
||||
foo bar(1) buzz<T>(1) zoo var v : Int = 0
|
||||
foo bar(1) buzz<T>(1) zoo typealias T = Int
|
||||
|
||||
foo bar(1) buzz<T>(1) zoo {}
|
||||
foo bar(1) buzz<T>(1) zoo init {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
|
||||
@@ -896,6 +896,8 @@ JetFile: ShortAnnotations.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('zoo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(init)('init')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
|
||||
@@ -13,11 +13,11 @@ class BinaryTree<T> : IMutableSet<T> {
|
||||
|
||||
// override var size : Int { get; private set; }
|
||||
|
||||
this(compare : Comparison<T>) {
|
||||
constructor(compare : Comparison<T>) {
|
||||
this.compare = asMatchableComparison(comparison)
|
||||
}
|
||||
|
||||
this() : this(naturalOrder<T>()) {
|
||||
constructor() : this(naturalOrder<T>()) {
|
||||
}
|
||||
|
||||
private [operator] fun T.compareTo(other : T) : Int = compare(this, other)
|
||||
@@ -135,7 +135,7 @@ class BinaryTree<T> : IMutableSet<T> {
|
||||
val up = Stack<TreeNode>()
|
||||
var lastNode : TreeNode
|
||||
|
||||
this() {
|
||||
init {
|
||||
if (root != null)
|
||||
down.push(root)
|
||||
}
|
||||
|
||||
@@ -151,24 +151,15 @@ JetFile: BinaryTree.kt
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiComment(EOL_COMMENT)('// override var size : Int { get; private set; }')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(this)('this')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(LPAR)('(')
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('compare')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
SECONDARY_CONSTRUCTOR
|
||||
PsiElement(constructor)('constructor')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('compare')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -181,10 +172,11 @@ JetFile: BinaryTree.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
CONSTRUCTOR_DELEGATION_CALL
|
||||
CONSTRUCTOR_DELEGATION_REFERENCE
|
||||
<empty list>
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
@@ -212,25 +204,21 @@ JetFile: BinaryTree.kt
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(this)('this')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(LPAR)('(')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
SECONDARY_CONSTRUCTOR
|
||||
PsiElement(constructor)('constructor')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(this)('this')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(LPAR)('(')
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiWhiteSpace(' ')
|
||||
CONSTRUCTOR_DELEGATION_CALL
|
||||
CONSTRUCTOR_DELEGATION_REFERENCE
|
||||
PsiElement(this)('this')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('naturalOrder')
|
||||
TYPE_ARGUMENT_LIST
|
||||
@@ -241,13 +229,11 @@ JetFile: BinaryTree.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
@@ -1819,14 +1805,9 @@ JetFile: BinaryTree.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('TreeNode')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(this)('this')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(LPAR)('(')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiElement(init)('init')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
|
||||
@@ -7,12 +7,4 @@ class A {
|
||||
init {
|
||||
x = 1
|
||||
}
|
||||
|
||||
val y = f()
|
||||
{
|
||||
x = 2
|
||||
}
|
||||
{
|
||||
x = 3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,55 +57,5 @@ JetFile: anonymousInitializer.kt
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
FUNCTION_LITERAL_ARGUMENT
|
||||
FUNCTION_LITERAL_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
BLOCK
|
||||
BINARY_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FUNCTION_LITERAL_ARGUMENT
|
||||
FUNCTION_LITERAL_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
BLOCK
|
||||
BINARY_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('3')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -9,7 +9,7 @@ enum class A {
|
||||
abc3
|
||||
|
||||
constructor(x: Int): this() {}
|
||||
{
|
||||
init {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,8 @@ JetFile: enumParsing.kt
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
ANONYMOUS_INITIALIZER
|
||||
PsiElement(init)('init')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
|
||||
Reference in New Issue
Block a user