Fix exception when type parameters appear in object declaration
#KT-14536 Fixed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
object A<!TYPE_PARAMETERS_IN_OBJECT!><T><!>
|
||||
object B<!TYPE_PARAMETERS_IN_OBJECT!><in T, out R><!>
|
||||
object C<!TYPE_PARAMETERS_IN_OBJECT!><T : Comparable<T>><!>
|
||||
|
||||
class D {
|
||||
companion object<!TYPE_PARAMETERS_IN_OBJECT!><T><!>
|
||||
}
|
||||
|
||||
class E {
|
||||
companion object<!TYPE_PARAMETERS_IN_OBJECT!><in T, out R><!>
|
||||
}
|
||||
|
||||
class F {
|
||||
companion object C<!TYPE_PARAMETERS_IN_OBJECT!><T : Comparable<T>><!>
|
||||
}
|
||||
|
||||
class G {
|
||||
companion object F<!TYPE_PARAMETERS_IN_OBJECT!><T><!>
|
||||
}
|
||||
|
||||
object H<!TYPE_PARAMETERS_IN_OBJECT!><T, R><!><!CONSTRUCTOR_IN_OBJECT!>()<!>
|
||||
@@ -0,0 +1,85 @@
|
||||
package
|
||||
|
||||
public object A</*0*/ T> {
|
||||
private constructor A</*0*/ T>()
|
||||
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
|
||||
}
|
||||
|
||||
public object B</*0*/ in T, /*1*/ out R> {
|
||||
private constructor B</*0*/ in T, /*1*/ out R>()
|
||||
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
|
||||
}
|
||||
|
||||
public object C</*0*/ T : kotlin.Comparable<T>> {
|
||||
private constructor C</*0*/ T : kotlin.Comparable<T>>()
|
||||
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
|
||||
}
|
||||
|
||||
public final class D {
|
||||
public constructor D()
|
||||
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
|
||||
|
||||
public companion object Companion</*0*/ T> {
|
||||
private constructor Companion</*0*/ T>()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
public final class E {
|
||||
public constructor E()
|
||||
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
|
||||
|
||||
public companion object Companion</*0*/ in T, /*1*/ out R> {
|
||||
private constructor Companion</*0*/ in T, /*1*/ out R>()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
public final class F {
|
||||
public constructor F()
|
||||
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
|
||||
|
||||
public companion object C</*0*/ T : kotlin.Comparable<T>> {
|
||||
private constructor C</*0*/ T : kotlin.Comparable<T>>()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
public final class G {
|
||||
public constructor G()
|
||||
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
|
||||
|
||||
public companion object F</*0*/ T> {
|
||||
private constructor F</*0*/ T>()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
public object H</*0*/ T, /*1*/ R> {
|
||||
private constructor H</*0*/ T, /*1*/ R>()
|
||||
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
|
||||
}
|
||||
@@ -7,16 +7,15 @@ JetFile: Everything.kt
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
|
||||
+27
-30
@@ -7,16 +7,15 @@ JetFile: TypeParametersAndParentheses.kt
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -26,16 +25,15 @@ JetFile: TypeParametersAndParentheses.kt
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -57,16 +55,15 @@ JetFile: TypeParametersAndParentheses.kt
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
|
||||
@@ -7,31 +7,29 @@ JetFile: TypeParameterss.kt
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace('\n\n')
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
@@ -41,16 +39,15 @@ JetFile: TypeParameterss.kt
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
|
||||
@@ -13,16 +13,15 @@ JetFile: Everything.kt
|
||||
OBJECT_LITERAL
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
@@ -81,4 +80,4 @@ JetFile: Everything.kt
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiElement(RBRACE)('}')
|
||||
+28
-31
@@ -13,16 +13,15 @@ JetFile: TypeParametersAndParentheses.kt
|
||||
OBJECT_LITERAL
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -50,16 +49,15 @@ JetFile: TypeParametersAndParentheses.kt
|
||||
OBJECT_LITERAL
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -89,20 +87,19 @@ JetFile: TypeParametersAndParentheses.kt
|
||||
OBJECT_LITERAL
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
CLASS_BODY
|
||||
PsiErrorElement:Expecting a class body
|
||||
<empty list>
|
||||
<empty list>
|
||||
@@ -13,16 +13,15 @@ JetFile: TypeParameterss.kt
|
||||
OBJECT_LITERAL
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
@@ -38,16 +37,15 @@ JetFile: TypeParameterss.kt
|
||||
OBJECT_LITERAL
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiErrorElement:Type parameters are not allowed for objects
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('R')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -97,4 +95,4 @@ JetFile: TypeParameterss.kt
|
||||
PsiElement(RPAR)(')')
|
||||
CLASS_BODY
|
||||
PsiErrorElement:Expecting a class body
|
||||
<empty list>
|
||||
<empty list>
|
||||
Reference in New Issue
Block a user