From 117cead1794ae71ec6a0255b7bd31b28118fb61c Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Thu, 14 Jul 2011 19:04:07 +0400 Subject: [PATCH] JET-183 Typechecker fails with enum constants + Tests for annotations --- .../jetbrains/jet/lang/types/TypeUtils.java | 4 +- idea/testData/checker/regression/Jet183-1.jet | 21 ++ idea/testData/psi/Imports_ERR.txt | 164 +++++---- idea/testData/psi/NamespaceBlock_ERR.jet | 2 - idea/testData/psi/NamespaceBlock_ERR.txt | 110 +++--- idea/testData/psi/Properties_ERR.txt | 10 +- idea/testData/psi/SimpleClassMembers_ERR.txt | 321 +++++++++--------- idea/testData/psi/When.txt | 34 +- 8 files changed, 371 insertions(+), 295 deletions(-) create mode 100644 idea/testData/checker/regression/Jet183-1.jet diff --git a/idea/src/org/jetbrains/jet/lang/types/TypeUtils.java b/idea/src/org/jetbrains/jet/lang/types/TypeUtils.java index 34ada968d38..ea190fc23e1 100644 --- a/idea/src/org/jetbrains/jet/lang/types/TypeUtils.java +++ b/idea/src/org/jetbrains/jet/lang/types/TypeUtils.java @@ -55,7 +55,9 @@ public class TypeUtils { if (!canHaveSubtypes(typeChecker, type)) { for (JetType other : types) { - if (!type.equals(other) && !typeChecker.isSubtypeOf(type, other)) { + // It makes sense to check for subtyping of other <: type, despite that + // type is not supposed to be open, for there're enums + if (!type.equals(other) && !typeChecker.isSubtypeOf(type, other) && !typeChecker.isSubtypeOf(other, type)) { return null; } } diff --git a/idea/testData/checker/regression/Jet183-1.jet b/idea/testData/checker/regression/Jet183-1.jet new file mode 100644 index 00000000000..599560ac69f --- /dev/null +++ b/idea/testData/checker/regression/Jet183-1.jet @@ -0,0 +1,21 @@ +enum class ProtocolState { + WAITING { + override fun signal() = ProtocolState.TALKING + } + + TALKING { + override fun signal() = ProtocolState.WAITING + } + + abstract fun signal() : ProtocolState +} + + +fun box(): String { + val x: ProtocolState = ProtocolState.WAITING + x = x.signal() + if (x != ProtocolState.TALKING) return "fail 1" + x = x.signal() + if (x != ProtocolState.WAITING) return "fail 2" + return "OK" +} \ No newline at end of file diff --git a/idea/testData/psi/Imports_ERR.txt b/idea/testData/psi/Imports_ERR.txt index 5d0bb433f54..b65a66108ad 100644 --- a/idea/testData/psi/Imports_ERR.txt +++ b/idea/testData/psi/Imports_ERR.txt @@ -49,78 +49,116 @@ JetFile: Imports_ERR.jet PsiWhiteSpace('\n') PsiElement(IDENTIFIER)('import') PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(DOT)('.') - PsiWhiteSpace('\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') + MODIFIER_LIST + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiWhiteSpace('\n') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('import') PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - PsiWhiteSpace('\n') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('import') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(DOT)('.') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiWhiteSpace('\n') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('import') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiErrorElement:Type name expected + PsiElement(as)('as') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace('\n') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('import') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiErrorElement:Type name expected + PsiElement(MUL)('*') PsiWhiteSpace(' ') PsiErrorElement:Expecting namespace or top level declaration PsiElement(as)('as') PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') + MODIFIER_LIST + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace('\n') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('import') PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - PsiElement(MUL)('*') - PsiWhiteSpace(' ') - PsiErrorElement:Cannot rename a all imported items to one identifier - PsiElement(as)('as') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') - PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - PsiElement(MUL)('*') - PsiWhiteSpace(' ') - PsiErrorElement:Cannot rename a all imported items to one identifier - PsiElement(as)('as') - PsiWhiteSpace('\n\n') - PsiElement(IDENTIFIER)('import') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiErrorElement:Type name expected + PsiElement(MUL)('*') PsiWhiteSpace(' ') PsiErrorElement:Expecting namespace or top level declaration PsiElement(as)('as') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(as)('as') + PsiErrorElement:Expecting identifier + + PsiWhiteSpace(' ') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') IMPORT_DIRECTIVE diff --git a/idea/testData/psi/NamespaceBlock_ERR.jet b/idea/testData/psi/NamespaceBlock_ERR.jet index fa0133ce0b4..66bf0b8d58f 100644 --- a/idea/testData/psi/NamespaceBlock_ERR.jet +++ b/idea/testData/psi/NamespaceBlock_ERR.jet @@ -7,8 +7,6 @@ import foo. as bar namespace foof { import foo.bar.* as bar - import foo.bar.* as - import foo as ; import foo. ; import foo.bar. ; diff --git a/idea/testData/psi/NamespaceBlock_ERR.txt b/idea/testData/psi/NamespaceBlock_ERR.txt index 73d4b73cabf..0a28fe1b9bf 100644 --- a/idea/testData/psi/NamespaceBlock_ERR.txt +++ b/idea/testData/psi/NamespaceBlock_ERR.txt @@ -19,38 +19,52 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n') PsiElement(IDENTIFIER)('import') PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(DOT)('.') - PsiWhiteSpace('\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') - PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - PsiWhiteSpace('\n') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('import') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(DOT)('.') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(as)('as') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n\n') NAMESPACE + MODIFIER_LIST + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiWhiteSpace('\n') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('import') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiWhiteSpace('\n') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('import') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiErrorElement:Type name expected + PsiElement(as)('as') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace('\n\n') PsiElement(namespace)('namespace') PsiWhiteSpace(' ') NAMESPACE_NAME @@ -79,27 +93,13 @@ JetFile: NamespaceBlock_ERR.jet IMPORT_DIRECTIVE PsiElement(import)('import') PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - PsiElement(MUL)('*') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') - PsiErrorElement:Cannot rename a all imported items to one identifier - PsiElement(as)('as') - PsiWhiteSpace('\n\n ') - PsiElement(IDENTIFIER)('import') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration PsiElement(as)('as') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration + PsiErrorElement:Expecting identifier + + PsiWhiteSpace(' ') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n ') IMPORT_DIRECTIVE @@ -252,10 +252,14 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('dsfgd') - PsiWhiteSpace('\n\n') CLASS + MODIFIER_LIST + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('dsfgd') + PsiWhiteSpace('\n\n') PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Bar') diff --git a/idea/testData/psi/Properties_ERR.txt b/idea/testData/psi/Properties_ERR.txt index a87ccf29d6f..b4462bae6b3 100644 --- a/idea/testData/psi/Properties_ERR.txt +++ b/idea/testData/psi/Properties_ERR.txt @@ -130,10 +130,14 @@ JetFile: Properties_ERR.jet PsiErrorElement:Expecting namespace or top level declaration PsiElement(EQ)('=') PsiWhiteSpace(' ') - PsiErrorElement:Expecting namespace or top level declaration - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n\n') PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n\n') PsiElement(val)('val') PsiWhiteSpace(' ') TYPE_REFERENCE diff --git a/idea/testData/psi/SimpleClassMembers_ERR.txt b/idea/testData/psi/SimpleClassMembers_ERR.txt index 74599c339fd..d7df8ddae92 100644 --- a/idea/testData/psi/SimpleClassMembers_ERR.txt +++ b/idea/testData/psi/SimpleClassMembers_ERR.txt @@ -34,164 +34,171 @@ JetFile: SimpleClassMembers_ERR.jet CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - PsiErrorElement:Expecting member declaration - PsiElement(IDENTIFIER)('sdfsd') + MODIFIER_LIST + ANNOTATION_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('sdfsd') PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n ') - FUN - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n\n ') - PROPERTY - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace('\n\n ') - PROPERTY - PsiElement(var)('var') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace('\n\n ') - TYPEDEF - PsiElement(type)('type') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - TYPE_PARAMETER_LIST - - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n\n ') - CONSTRUCTOR - PsiElement(this)('this') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - INITIALIZER_LIST - THIS_CALL - THIS_CONSTRUCTOR_REFERENCE - PsiElement(this)('this') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('c') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiErrorElement:Expecting a '>' - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n\n ') - CONSTRUCTOR - PsiElement(this)('this') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - INITIALIZER_LIST - THIS_CALL - THIS_CONSTRUCTOR_REFERENCE - PsiElement(this)('this') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('c') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') + PsiErrorElement:Expecting member declaration + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n ') - CONSTRUCTOR - PsiElement(this)('this') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - INITIALIZER_LIST - PsiErrorElement:Expecting constructor call (this(...)) or supertype initializer - PsiElement(MINUS)('-') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace('\n\n ') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n ') + CONSTRUCTOR + PsiElement(this)('this') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + INITIALIZER_LIST + THIS_CALL + THIS_CONSTRUCTOR_REFERENCE + PsiElement(this)('this') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('c') + PsiElement(RPAR)(')') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + DELEGATOR_SUPER_CALL + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiErrorElement:Expecting a '>' + + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + CONSTRUCTOR + PsiElement(this)('this') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + INITIALIZER_LIST + THIS_CALL + THIS_CONSTRUCTOR_REFERENCE + PsiElement(this)('this') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('c') + PsiElement(RPAR)(')') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + DELEGATOR_SUPER_CALL + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + CONSTRUCTOR + PsiElement(this)('this') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + INITIALIZER_LIST + PsiErrorElement:Expecting constructor call (this(...)) or supertype initializer + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') \ No newline at end of file + PsiErrorElement:Missing '} + \ No newline at end of file diff --git a/idea/testData/psi/When.txt b/idea/testData/psi/When.txt index d535df43f4f..110bad28a3f 100644 --- a/idea/testData/psi/When.txt +++ b/idea/testData/psi/When.txt @@ -387,14 +387,15 @@ JetFile: When.jet PsiElement(when)('when') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(LBRACE)('{') @@ -1015,14 +1016,15 @@ JetFile: When.jet PsiElement(when)('when') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(LBRACE)('{')