diff --git a/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java b/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java index 7ba50adf6a2..27357d4d437 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java @@ -31,7 +31,7 @@ public interface KtNodeTypes { IElementType DESTRUCTURING_DECLARATION = new KtNodeType("DESTRUCTURING_DECLARATION", KtDestructuringDeclaration.class); IElementType DESTRUCTURING_DECLARATION_ENTRY = new KtNodeType("DESTRUCTURING_DECLARATION_ENTRY", KtDestructuringDeclarationEntry.class); - KtNodeType TYPEDEF = new KtNodeType("TYPEDEF", KtTypedef.class); + //KtNodeType TYPEDEF = new KtNodeType("TYPEDEF", KtTypedef.class); IElementType OBJECT_DECLARATION = KtStubElementTypes.OBJECT_DECLARATION; IElementType ENUM_ENTRY = KtStubElementTypes.ENUM_ENTRY; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java index 8ad105e963b..7c79500c79c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java @@ -1256,9 +1256,11 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing { else if (keywordToken == VAL_KEYWORD || keywordToken == VAR_KEYWORD) { declType = myJetParsing.parseProperty(true); } + /* else if (keywordToken == TYPE_ALIAS_KEYWORD) { declType = myJetParsing.parseTypeAlias(); } + */ else if (keywordToken == OBJECT_KEYWORD) { // Object expression may appear at the statement position: should parse it // as expression instead of object declaration diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java index b31de91bec6..b6a7e64624e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java @@ -22,7 +22,6 @@ import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.TokenSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.KtNodeType; import org.jetbrains.kotlin.lexer.KtKeywordToken; import org.jetbrains.kotlin.lexer.KtTokens; @@ -408,9 +407,11 @@ public class KotlinParsing extends AbstractKotlinParsing { else if (keywordToken == VAL_KEYWORD || keywordToken == VAR_KEYWORD) { declType = parseProperty(); } + /* else if (keywordToken == TYPE_ALIAS_KEYWORD) { declType = parseTypeAlias(); } + */ else if (keywordToken == OBJECT_KEYWORD) { parseObject(NameParsingMode.REQUIRED, true); declType = OBJECT_DECLARATION; @@ -1069,9 +1070,11 @@ public class KotlinParsing extends AbstractKotlinParsing { else if (keywordToken == VAL_KEYWORD || keywordToken == VAR_KEYWORD) { declType = parseProperty(); } + /* else if (keywordToken == TYPE_ALIAS_KEYWORD) { declType = parseTypeAlias(); } + */ else if (keywordToken == OBJECT_KEYWORD) { parseObject(isDefault ? NameParsingMode.ALLOWED : NameParsingMode.REQUIRED, true); declType = OBJECT_DECLARATION; @@ -1174,6 +1177,7 @@ public class KotlinParsing extends AbstractKotlinParsing { * : modifiers "typealias" SimpleName (typeParameters typeConstraints)? "=" type * ; */ + /* KtNodeType parseTypeAlias() { assert _at(TYPE_ALIAS_KEYWORD); @@ -1193,6 +1197,7 @@ public class KotlinParsing extends AbstractKotlinParsing { return TYPEDEF; } + */ /* * variableDeclarationEntry diff --git a/compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.kt b/compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.kt deleted file mode 100644 index 28d59b7d04a..00000000000 --- a/compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.kt +++ /dev/null @@ -1,5 +0,0 @@ -typealias Foo = Any - -fun foo() { - typealias Bar = Any -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.txt b/compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.txt deleted file mode 100644 index 65a6ac47e1f..00000000000 --- a/compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.txt +++ /dev/null @@ -1,3 +0,0 @@ -package - -public fun foo(): kotlin.Unit diff --git a/compiler/testData/psi/EOLsOnRollback.kt b/compiler/testData/psi/EOLsOnRollback.kt index d92e3e2f773..e698c02e3db 100644 --- a/compiler/testData/psi/EOLsOnRollback.kt +++ b/compiler/testData/psi/EOLsOnRollback.kt @@ -3,7 +3,6 @@ fun foo() { fun foo() class foo - typealias x = t var r @a var foo = 4 diff --git a/compiler/testData/psi/EOLsOnRollback.txt b/compiler/testData/psi/EOLsOnRollback.txt index 41d5803abab..1bb1f574241 100644 --- a/compiler/testData/psi/EOLsOnRollback.txt +++ b/compiler/testData/psi/EOLsOnRollback.txt @@ -32,18 +32,6 @@ JetFile: EOLsOnRollback.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiWhiteSpace('\n\n ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiWhiteSpace('\n ') PROPERTY PsiElement(var)('var') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/FunctionTypes.kt b/compiler/testData/psi/FunctionTypes.kt index 79ec7fcb8f0..fafeed7a642 100644 --- a/compiler/testData/psi/FunctionTypes.kt +++ b/compiler/testData/psi/FunctionTypes.kt @@ -1,24 +1,24 @@ -typealias f = (@[a] a) -> b -typealias f = (a) -> b -typealias f = () -> @[x] b -typealias f = () -> Unit +val v: (@[a] a) -> b +val v: (a) -> b +val v: () -> @[x] b +val v: () -> Unit -typealias f = (a : @[a] a) -> b -typealias f = (a : a) -> b -typealias f = () -> b -typealias f = () -> Unit +val v: (a : @[a] a) -> b +val v: (a : a) -> b +val v: () -> b +val v: () -> Unit -typealias f = (a : @[a] a, foo, x : bar) -> b -typealias f = (foo, a : a) -> b -typealias f = (foo, a : (a) -> b) -> b -typealias f = (foo, a : (a) -> b) -> () -> Unit +val v: (a : @[a] a, foo, x : bar) -> b +val v: (foo, a : a) -> b +val v: (foo, a : (a) -> b) -> b +val v: (foo, a : (a) -> b) -> () -> Unit //type f = (ref foo, ref a : (ref a) -> b) -> () -> Unit -typealias f = T.() -> Unit -typealias f = T.T.() -> Unit -typealias f = T.T.() -> Unit +val v: T.() -> Unit +val v: T.T.() -> Unit +val v: T.T.() -> Unit -typealias f = @[a] T.() -> Unit -typealias f = @[a] T.T.() -> Unit -typealias f = @[a] T.T.() -> Unit +val v: @[a] T.() -> Unit +val v: @[a] T.T.() -> Unit +val v: @[a] T.T.() -> Unit diff --git a/compiler/testData/psi/FunctionTypes.txt b/compiler/testData/psi/FunctionTypes.txt index 4f866a7d39e..f69ec5e1980 100644 --- a/compiler/testData/psi/FunctionTypes.txt +++ b/compiler/testData/psi/FunctionTypes.txt @@ -3,13 +3,12 @@ JetFile: FunctionTypes.kt IMPORT_LIST - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -40,13 +39,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -65,13 +63,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -96,13 +93,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -116,13 +112,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -156,13 +151,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -185,13 +179,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -205,13 +198,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -225,13 +217,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -283,13 +274,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -319,13 +309,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -368,13 +357,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST @@ -427,13 +415,12 @@ JetFile: FunctionTypes.kt PsiWhiteSpace('\n\n') PsiComment(EOL_COMMENT)('//type f = (ref foo, ref a : (ref a) -> b) -> () -> Unit') PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE FUNCTION_TYPE_RECEIVER @@ -453,13 +440,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE FUNCTION_TYPE_RECEIVER @@ -483,13 +469,12 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE FUNCTION_TYPE_RECEIVER @@ -536,12 +521,11 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE @@ -573,12 +557,11 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE @@ -614,12 +597,11 @@ JetFile: FunctionTypes.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE @@ -676,4 +658,4 @@ JetFile: FunctionTypes.kt TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Unit') + PsiElement(IDENTIFIER)('Unit') \ No newline at end of file diff --git a/compiler/testData/psi/FunctionTypes_ERR.kt b/compiler/testData/psi/FunctionTypes_ERR.kt index 14ef9e8387b..995dcb19f56 100644 --- a/compiler/testData/psi/FunctionTypes_ERR.kt +++ b/compiler/testData/psi/FunctionTypes_ERR.kt @@ -1 +1 @@ -typealias f = (a, ) -> b +val v: (a, ) -> b diff --git a/compiler/testData/psi/FunctionTypes_ERR.txt b/compiler/testData/psi/FunctionTypes_ERR.txt index c8fe8f71f30..7223d25047c 100644 --- a/compiler/testData/psi/FunctionTypes_ERR.txt +++ b/compiler/testData/psi/FunctionTypes_ERR.txt @@ -3,13 +3,12 @@ JetFile: FunctionTypes_ERR.kt IMPORT_LIST - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST diff --git a/compiler/testData/psi/LocalDeclarations.kt b/compiler/testData/psi/LocalDeclarations.kt index d0939b50c72..b799840c6fb 100644 --- a/compiler/testData/psi/LocalDeclarations.kt +++ b/compiler/testData/psi/LocalDeclarations.kt @@ -6,6 +6,4 @@ fun foo() { out val foo = 5 @a var foo = 4 - typealias f = T.() -> Unit - } diff --git a/compiler/testData/psi/LocalDeclarations.txt b/compiler/testData/psi/LocalDeclarations.txt index 421edd50d1c..f46dc25a372 100644 --- a/compiler/testData/psi/LocalDeclarations.txt +++ b/compiler/testData/psi/LocalDeclarations.txt @@ -91,31 +91,5 @@ JetFile: LocalDeclarations.kt PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('4') - PsiWhiteSpace('\n ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - FUNCTION_TYPE_RECEIVER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Unit') - PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/SimpleClassMembers.kt b/compiler/testData/psi/SimpleClassMembers.kt index e5e974e75da..4703a23d667 100644 --- a/compiler/testData/psi/SimpleClassMembers.kt +++ b/compiler/testData/psi/SimpleClassMembers.kt @@ -12,9 +12,6 @@ class foo { val x var f - - typealias foo = bar - } class Bar { @@ -45,9 +42,6 @@ class foo { val x var f - - typealias foo = bar - } fun foo() @@ -56,8 +50,6 @@ class foo { var f - typealias foo = bar - companion object { } diff --git a/compiler/testData/psi/SimpleClassMembers.txt b/compiler/testData/psi/SimpleClassMembers.txt index b0e90da90bf..d7800bfd9bf 100644 --- a/compiler/testData/psi/SimpleClassMembers.txt +++ b/compiler/testData/psi/SimpleClassMembers.txt @@ -55,19 +55,7 @@ JetFile: SimpleClassMembers.kt PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('f') - PsiWhiteSpace('\n\n ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n\n ') + PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') CLASS @@ -234,19 +222,7 @@ JetFile: SimpleClassMembers.kt PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('f') - PsiWhiteSpace('\n\n ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n\n ') + PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUN @@ -267,18 +243,6 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('f') PsiWhiteSpace('\n\n ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST PsiElement(companion)('companion') diff --git a/compiler/testData/psi/SimpleClassMembers_ERR.kt b/compiler/testData/psi/SimpleClassMembers_ERR.kt index db6c137ad35..4cc20f1f359 100644 --- a/compiler/testData/psi/SimpleClassMembers_ERR.kt +++ b/compiler/testData/psi/SimpleClassMembers_ERR.kt @@ -11,7 +11,4 @@ class foo { val x var f - - typealias foo = ; - } \ No newline at end of file diff --git a/compiler/testData/psi/SimpleClassMembers_ERR.txt b/compiler/testData/psi/SimpleClassMembers_ERR.txt index dc1e52614c5..5822a8a4093 100644 --- a/compiler/testData/psi/SimpleClassMembers_ERR.txt +++ b/compiler/testData/psi/SimpleClassMembers_ERR.txt @@ -53,17 +53,5 @@ JetFile: SimpleClassMembers_ERR.kt PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('f') - PsiWhiteSpace('\n\n ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n\n') - PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/TypeDef.kt b/compiler/testData/psi/TypeDef.kt deleted file mode 100644 index c622e0b0bb9..00000000000 --- a/compiler/testData/psi/TypeDef.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo.bar.goo - -typealias foo = bar -typealias foo = bar -typealias foo = bar -typealias foo = bar -typealias foo = bar - -typealias foo = bar ; -typealias foo = bar ; - -typealias foo = bar ; -typealias foo = bar ; -typealias foo = bar ; diff --git a/compiler/testData/psi/TypeDef.txt b/compiler/testData/psi/TypeDef.txt deleted file mode 100644 index 154559544c2..00000000000 --- a/compiler/testData/psi/TypeDef.txt +++ /dev/null @@ -1,230 +0,0 @@ -JetFile: TypeDef.kt - PACKAGE_DIRECTIVE - PsiElement(package)('package') - PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('goo') - IMPORT_LIST - - PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('B') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('B') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('B') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('B') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - PsiElement(SEMICOLON)(';') diff --git a/compiler/testData/psi/TypeDef_ERR.kt b/compiler/testData/psi/TypeDef_ERR.kt deleted file mode 100644 index 1681d75bf3e..00000000000 --- a/compiler/testData/psi/TypeDef_ERR.kt +++ /dev/null @@ -1,17 +0,0 @@ -typealias -typealias foo -typealias foo = -typealias ; -typealias foo ; -typealias foo = ; -typealias = foo -typealias = -typealias = foo ; -typealias = ; - -typealias foo<> = bar -typealias foo = bar -typealias foo = bar - -class -typealias foo = bar \ No newline at end of file diff --git a/compiler/testData/psi/TypeDef_ERR.txt b/compiler/testData/psi/TypeDef_ERR.txt deleted file mode 100644 index 25689eba8e8..00000000000 --- a/compiler/testData/psi/TypeDef_ERR.txt +++ /dev/null @@ -1,196 +0,0 @@ -JetFile: TypeDef_ERR.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - TYPEDEF - PsiElement(typealias)('typealias') - PsiErrorElement:Type name expected - - PsiWhiteSpace('\n') - TYPE_REFERENCE - PsiErrorElement:Type expected - - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiErrorElement:Expecting '=' - - PsiWhiteSpace('\n') - TYPE_REFERENCE - PsiErrorElement:Type expected - - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace('\n') - TYPE_REFERENCE - PsiErrorElement:Type expected - - TYPEDEF - PsiElement(typealias)('typealias') - PsiErrorElement:Type name expected - - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiErrorElement:Expecting '=' - - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiErrorElement:Type name expected - - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiErrorElement:Type name expected - - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace('\n') - TYPE_REFERENCE - PsiErrorElement:Type expected - - TYPEDEF - PsiElement(typealias)('typealias') - PsiErrorElement:Type name expected - - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiErrorElement:Type name expected - - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - PsiErrorElement:Type parameter declaration expected - - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiErrorElement:Type parameter declaration expected - - PsiWhiteSpace(' ') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('A') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('B') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n\n') - CLASS - PsiElement(class)('class') - PsiErrorElement:Name expected - - PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') diff --git a/compiler/testData/psi/annotation/ShortAnnotations.kt b/compiler/testData/psi/annotation/ShortAnnotations.kt index df55d9252e0..61976fc6c79 100644 --- a/compiler/testData/psi/annotation/ShortAnnotations.kt +++ b/compiler/testData/psi/annotation/ShortAnnotations.kt @@ -5,7 +5,6 @@ foo bar(1) buzz(1) zoo object B foo bar(1) buzz(1) zoo fun a() {} foo bar(1) buzz(1) zoo val c : Int = 0 foo bar(1) buzz(1) zoo var v : Int = 0 -foo bar(1) buzz(1) zoo typealias T = Int class Foo { @@ -15,7 +14,6 @@ class Foo { foo bar(1) buzz(1) zoo fun a() {} foo bar(1) buzz(1) zoo val c : Int = 0 foo bar(1) buzz(1) zoo var v : Int = 0 - foo bar(1) buzz(1) zoo typealias T = Int foo bar(1) buzz(1) zoo init {} } diff --git a/compiler/testData/psi/annotation/ShortAnnotations.txt b/compiler/testData/psi/annotation/ShortAnnotations.txt index 9968d7487e9..3a320576bd8 100644 --- a/compiler/testData/psi/annotation/ShortAnnotations.txt +++ b/compiler/testData/psi/annotation/ShortAnnotations.txt @@ -244,48 +244,6 @@ JetFile: ShortAnnotations.kt PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0') - PsiWhiteSpace('\n') - PsiErrorElement:Expecting a top level declaration - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a top level declaration - PsiElement(IDENTIFIER)('bar') - PsiErrorElement:Expecting a top level declaration - PsiElement(LPAR)('(') - PsiErrorElement:Expecting a top level declaration - PsiElement(INTEGER_LITERAL)('1') - PsiErrorElement:Expecting a top level declaration - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a top level declaration - PsiElement(IDENTIFIER)('buzz') - PsiErrorElement:Expecting a top level declaration - PsiElement(LT)('<') - PsiErrorElement:Expecting a top level declaration - PsiElement(IDENTIFIER)('T') - PsiErrorElement:Expecting a top level declaration - PsiElement(GT)('>') - PsiErrorElement:Expecting a top level declaration - PsiElement(LPAR)('(') - PsiErrorElement:Expecting a top level declaration - PsiElement(INTEGER_LITERAL)('1') - PsiErrorElement:Expecting a top level declaration - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a top level declaration - PsiElement(IDENTIFIER)('zoo') - PsiWhiteSpace(' ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') PsiWhiteSpace('\n\n\n') CLASS PsiElement(class)('class') @@ -540,48 +498,6 @@ JetFile: ShortAnnotations.kt PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0') - PsiWhiteSpace('\n ') - PsiErrorElement:Expecting member declaration - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting member declaration - PsiElement(IDENTIFIER)('bar') - PsiErrorElement:Expecting member declaration - PsiElement(LPAR)('(') - PsiErrorElement:Expecting member declaration - PsiElement(INTEGER_LITERAL)('1') - PsiErrorElement:Expecting member declaration - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting member declaration - PsiElement(IDENTIFIER)('buzz') - PsiErrorElement:Expecting member declaration - PsiElement(LT)('<') - PsiErrorElement:Expecting member declaration - PsiElement(IDENTIFIER)('T') - PsiErrorElement:Expecting member declaration - PsiElement(GT)('>') - PsiErrorElement:Expecting member declaration - PsiElement(LPAR)('(') - PsiErrorElement:Expecting member declaration - PsiElement(INTEGER_LITERAL)('1') - PsiErrorElement:Expecting member declaration - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting member declaration - PsiElement(IDENTIFIER)('zoo') - PsiWhiteSpace(' ') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') PsiWhiteSpace('\n\n ') PsiErrorElement:Expecting member declaration PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/annotation/TypeAnnotations.kt b/compiler/testData/psi/annotation/TypeAnnotations.kt deleted file mode 100644 index d6644f94609..00000000000 --- a/compiler/testData/psi/annotation/TypeAnnotations.kt +++ /dev/null @@ -1,5 +0,0 @@ -class F(a : @[a] @[b] B) - -typealias f = @[b] @[x] F<@[x] A, B> - -class C : @[a] B, @[c d] E by F, @[g] H(), @[i] () -> Unit diff --git a/compiler/testData/psi/annotation/TypeAnnotations.txt b/compiler/testData/psi/annotation/TypeAnnotations.txt deleted file mode 100644 index f267a3b719e..00000000000 --- a/compiler/testData/psi/annotation/TypeAnnotations.txt +++ /dev/null @@ -1,207 +0,0 @@ -JetFile: TypeAnnotations.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('F') - PRIMARY_CONSTRUCTOR - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('F') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(GT)('>') - PsiWhiteSpace('\n\n') - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('C') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - SUPER_TYPE_LIST - SUPER_TYPE_ENTRY - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATED_SUPER_TYPE_ENTRY - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('c') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('d') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiWhiteSpace(' ') - PsiElement(by)('by') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('F') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - SUPER_TYPE_CALL_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('g') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('H') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - SUPER_TYPE_ENTRY - TYPE_REFERENCE - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('i') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Unit') diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.kt b/compiler/testData/psi/examples/FunctionsAndTypes.kt index b9f67b47382..5fad1d04de6 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.kt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.kt @@ -1,27 +1,3 @@ -typealias f1 = (T) -> X -// type f1 = {(T) => X} -typealias f2 = (T, E) -> X -// type f2 = {(T, E) => X} -typealias f_tuple = (Pair) -> X -//type f_tuple = {((T, E)) => X} -typealias hof = (X) -> (T) -> Y -//type hof = { (X) => {(T) => Y} } -typealias hof2 = ( (X) -> Y) -> (Y) -> Z -//type hof2 = { {(X) => Y} => {(Y) => Z} } - - -typealias Comparison = (a : T, b : T) -> Int -//type Comparison = {(a : T, b : T) => Int} -typealias Equality = (a : T, b : T) -> Boolean -//type Equality = {(a : T, b : T) => Boolean} -typealias HashFunction = (obj : T) -> Int -//type HashFunction = {(obj : T) => Int} -typealias Runnable = () -> Unit -//type Runnable = {() => ()} -typealias Function1 = (input : T) -> R -//type Function1 = {(input : T) => R} - - fun f1(t : T) : X = something(t) val f1 = {t : T -> something(t)} diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.txt b/compiler/testData/psi/examples/FunctionsAndTypes.txt index a88cb3b0206..d376ee7a0fe 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.txt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.txt @@ -3,410 +3,6 @@ JetFile: FunctionsAndTypes.kt IMPORT_LIST - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f1') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('// type f1 = {(T) => X}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f2') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('// type f2 = {(T, E) => X}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f_tuple') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Pair') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiElement(GT)('>') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('//type f_tuple = {((T, E)) => X}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('hof') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Y') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('//type hof = { (X) => {(T) => Y} }') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('hof2') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiWhiteSpace(' ') - VALUE_PARAMETER - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Z') - PsiWhiteSpace('\n') - PsiComment(EOL_COMMENT)('//type hof2 = { {(X) => Y} => {(Y) => Z} }') - PsiWhiteSpace('\n\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Comparison') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(in)('in') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('//type Comparison = {(a : T, b : T) => Int}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Equality') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(in)('in') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Boolean') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('//type Equality = {(a : T, b : T) => Boolean}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('HashFunction') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(in)('in') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('obj') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('//type HashFunction = {(obj : T) => Int}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Runnable') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Unit') - PsiWhiteSpace('\n') - TYPEDEF - PsiComment(EOL_COMMENT)('//type Runnable = {() => ()}') - PsiWhiteSpace('\n') - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Function1') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(in)('in') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(out)('out') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('R') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('input') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('R') - PsiWhiteSpace('\n') - PsiComment(EOL_COMMENT)('//type Function1 = {(input : T) => R}') - PsiWhiteSpace('\n\n\n') FUN PsiElement(fun)('fun') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/util/Comparison.kt b/compiler/testData/psi/examples/util/Comparison.kt index 8c890e5c0af..51e3495636d 100644 --- a/compiler/testData/psi/examples/util/Comparison.kt +++ b/compiler/testData/psi/examples/util/Comparison.kt @@ -1,5 +1,3 @@ -typealias Comparison = (T, T) -> Int - fun naturalOrder>(a : T, b : T) : Int = a.compareTo(b) fun castingNaturalOrder(a : Object, b : Object) : Int = (a as Comparable).compareTo(b as Comparable) @@ -8,8 +6,6 @@ enum class ComparisonResult { LS, EQ, GR; } -typealias MatchableComparison = (T, T) -> ComparisonResult - fun asMatchableComparison(cmp : Comparison) : MatchableComparison = {a, b -> val res = cmp(a, b) if (res == 0) return ComparisonResult.EQ diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index f187e856c95..b72fe1c9ddd 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -3,46 +3,6 @@ JetFile: Comparison.kt IMPORT_LIST - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Comparison') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(in)('in') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace('\n\n') FUN PsiElement(fun)('fun') PsiWhiteSpace(' ') @@ -230,46 +190,6 @@ JetFile: Comparison.kt PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('MatchableComparison') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - MODIFIER_LIST - PsiElement(in)('in') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('ComparisonResult') - PsiWhiteSpace('\n\n') FUN PsiElement(fun)('fun') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt index ebcdce20335..942b30fc900 100644 --- a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt +++ b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt @@ -1,10 +1,10 @@ -typealias f = (((S).() -> S).() -> S) -typealias f = ((T.() -> S).() -> S) -typealias f = ((T.T.() -> S).() -> S) -typealias f = ((T.T.() -> S).() -> S) -typealias f = (((S).() -> S).() -> S) +val v: (((S).() -> S).() -> S) +val v: ((T.() -> S).() -> S) +val v: ((T.T.() -> S).() -> S) +val v: ((T.T.() -> S).() -> S) +val v: (((S).() -> S).() -> S) -typealias f = @[a] (@[a] ((S).() -> S).() -> S) -typealias f = @[a] (@[a] (T.() -> S).() -> S) -typealias f = @[a] (@[a] (T.() -> S).() -> S) -typealias f = @[a] (@[a] ((S).() -> S).() -> S) \ No newline at end of file +val v: @[a] (@[a] ((S).() -> S).() -> S) +val v: @[a] (@[a] (T.() -> S).() -> S) +val v: @[a] (@[a] (T.() -> S).() -> S) +val v: @[a] (@[a] ((S).() -> S).() -> S) \ No newline at end of file diff --git a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt index 9f9218b2cbe..b59e8df7f4e 100644 --- a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt @@ -3,12 +3,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt IMPORT_LIST - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE PsiElement(LPAR)('(') @@ -49,12 +48,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE PsiElement(LPAR)('(') @@ -93,12 +91,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE PsiElement(LPAR)('(') @@ -141,12 +138,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE PsiElement(LPAR)('(') @@ -212,12 +208,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE PsiElement(LPAR)('(') @@ -258,13 +253,12 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION PsiElement(AT)('@') @@ -326,12 +320,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION @@ -392,12 +385,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION @@ -473,12 +465,11 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiElement(IDENTIFIER)('S') PsiElement(RPAR)(')') PsiWhiteSpace('\n') - TYPEDEF - PsiElement(typealias)('typealias') + PROPERTY + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + PsiElement(IDENTIFIER)('v') + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION @@ -539,4 +530,4 @@ JetFile: FunctionTypesWithFunctionReceivers.kt USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('S') - PsiElement(RPAR)(')') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index b9c27728631..933c5b595a5 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -18061,21 +18061,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { } } - @TestMetadata("compiler/testData/diagnostics/tests/typedefs") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Typedefs extends AbstractDiagnosticsTest { - public void testAllFilesPresentInTypedefs() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/typedefs"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("TypedefsUnsupported.kt") - public void testTypedefsUnsupported() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typedefs/TypedefsUnsupported.kt"); - doTest(fileName); - } - } - @TestMetadata("compiler/testData/diagnostics/tests/unit") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java index 5a9382ad615..4958ddf4f54 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java @@ -727,18 +727,6 @@ public class ParsingTestGenerated extends AbstractParsingTest { doParsingTest(fileName); } - @TestMetadata("TypeDef.kt") - public void testTypeDef() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/psi/TypeDef.kt"); - doParsingTest(fileName); - } - - @TestMetadata("TypeDef_ERR.kt") - public void testTypeDef_ERR() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/psi/TypeDef_ERR.kt"); - doParsingTest(fileName); - } - @TestMetadata("TypeExpressionAmbiguities_ERR.kt") public void testTypeExpressionAmbiguities_ERR() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/psi/TypeExpressionAmbiguities_ERR.kt"); @@ -843,12 +831,6 @@ public class ParsingTestGenerated extends AbstractParsingTest { doParsingTest(fileName); } - @TestMetadata("TypeAnnotations.kt") - public void testTypeAnnotations() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/psi/annotation/TypeAnnotations.kt"); - doParsingTest(fileName); - } - @TestMetadata("compiler/testData/psi/annotation/at") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)