From 32a64b888ea103b85fab1a1808b682b0090a23e6 Mon Sep 17 00:00:00 2001 From: Arsen Nagdalian Date: Sat, 18 Jul 2020 22:57:23 +0300 Subject: [PATCH] [Parser] Add parsing of function's contract either before or after type constraints --- .../kotlin/parsing/KotlinParsing.java | 10 +- .../FunctionWithTypeConstraintsAndContract.kt | 12 - ...FunctionWithTypeConstraintsAndContract.txt | 169 -------- ...FunctionsWithTypeConstraintsAndContract.kt | 28 ++ ...unctionsWithTypeConstraintsAndContract.txt | 360 ++++++++++++++++++ .../kotlin/parsing/ParsingTestGenerated.java | 10 +- 6 files changed, 401 insertions(+), 188 deletions(-) delete mode 100644 compiler/testData/psi/FunctionWithTypeConstraintsAndContract.kt delete mode 100644 compiler/testData/psi/FunctionWithTypeConstraintsAndContract.txt create mode 100644 compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.kt create mode 100644 compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.txt diff --git a/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java b/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java index da55c239040..965a98b4fd8 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java +++ b/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java @@ -1671,10 +1671,14 @@ public class KotlinParsing extends AbstractKotlinParsing { parseTypeRef(); } - parseFunctionContract(); + boolean functionContractOccurred = parseFunctionContract(); parseTypeConstraintsGuarded(typeParameterListOccurred); + if (!functionContractOccurred) { + parseFunctionContract(); + } + if (at(SEMICOLON)) { advance(); // SEMICOLON } @@ -1995,10 +1999,12 @@ public class KotlinParsing extends AbstractKotlinParsing { constraint.done(TYPE_CONSTRAINT); } - private void parseFunctionContract() { + private boolean parseFunctionContract() { if (at(CONTRACT_KEYWORD)) { myExpressionParsing.parseContractDescriptionBlock(); + return true; } + return false; } /* diff --git a/compiler/testData/psi/FunctionWithTypeConstraintsAndContract.kt b/compiler/testData/psi/FunctionWithTypeConstraintsAndContract.kt deleted file mode 100644 index 17aaa220cb8..00000000000 --- a/compiler/testData/psi/FunctionWithTypeConstraintsAndContract.kt +++ /dev/null @@ -1,12 +0,0 @@ -fun someFunctionWithTypeConstraints(arg: E?, block: () -> T): String - contract [ - returns() implies (arg != null), - callsInPlace(block, EXACTLY_ONCE), - ] - where T : MyClass, - E : MyOtherClass -{ - block() - arg ?: throw NullArgumentException() - return "some string" -} diff --git a/compiler/testData/psi/FunctionWithTypeConstraintsAndContract.txt b/compiler/testData/psi/FunctionWithTypeConstraintsAndContract.txt deleted file mode 100644 index a9c98782be7..00000000000 --- a/compiler/testData/psi/FunctionWithTypeConstraintsAndContract.txt +++ /dev/null @@ -1,169 +0,0 @@ -KtFile: FunctionWithTypeConstraintsAndContract.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - FUN - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('someFunctionWithTypeConstraints') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('E') - PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('arg') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - NULLABLE_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiElement(QUEST)('?') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('block') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiWhiteSpace('\n ') - PsiElement(contract)('contract') - PsiWhiteSpace(' ') - CONTRACT_EFFECT_LIST - PsiElement(LBRACKET)('[') - PsiWhiteSpace('\n ') - CONTRACT_EFFECT - BINARY_EXPRESSION - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('returns') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - OPERATION_REFERENCE - PsiElement(IDENTIFIER)('implies') - PsiWhiteSpace(' ') - PARENTHESIZED - PsiElement(LPAR)('(') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('arg') - PsiWhiteSpace(' ') - OPERATION_REFERENCE - PsiElement(EXCLEQ)('!=') - PsiWhiteSpace(' ') - NULL - PsiElement(null)('null') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - CONTRACT_EFFECT - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('callsInPlace') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('block') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('EXACTLY_ONCE') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n ') - PsiElement(where)('where') - PsiWhiteSpace(' ') - TYPE_CONSTRAINT_LIST - TYPE_CONSTRAINT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('MyClass') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - TYPE_CONSTRAINT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('MyOtherClass') - PsiWhiteSpace('\n') - BLOCK - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('block') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('arg') - PsiWhiteSpace(' ') - OPERATION_REFERENCE - PsiElement(ELVIS)('?:') - PsiWhiteSpace(' ') - THROW - PsiElement(throw)('throw') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('NullArgumentException') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - STRING_TEMPLATE - PsiElement(OPEN_QUOTE)('"') - LITERAL_STRING_TEMPLATE_ENTRY - PsiElement(REGULAR_STRING_PART)('some string') - PsiElement(CLOSING_QUOTE)('"') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.kt b/compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.kt new file mode 100644 index 00000000000..817e3a74890 --- /dev/null +++ b/compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.kt @@ -0,0 +1,28 @@ +// the following functions have type constraints and contracts written in different order +// any order is correct + +fun someFunctionWithTypeConstraints(arg: E?, block: () -> T): String + contract [ + returns() implies (arg != null), + callsInPlace(block, EXACTLY_ONCE), + ] + where T : MyClass, + E : MyOtherClass +{ + block() + arg ?: throw NullArgumentException() + return "some string" +} + +fun anotherFunctionWithTypeConstraints(data: D?, arg: T?, block: () -> Unit) + where D : SuperType, + T : SomeType + contract [ + returns() implies (data != null), + returns() implies (arg != null) + ] +{ + require(data != null) + require(arg != null) + block() +} \ No newline at end of file diff --git a/compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.txt b/compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.txt new file mode 100644 index 00000000000..e40c041b4a6 --- /dev/null +++ b/compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.txt @@ -0,0 +1,360 @@ +KtFile: FunctionsWithTypeConstraintsAndContract.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PsiComment(EOL_COMMENT)('// the following functions have type constraints and contracts written in different order') + PsiWhiteSpace('\n') + PsiComment(EOL_COMMENT)('// any order is correct') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('someFunctionWithTypeConstraints') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('E') + PsiElement(GT)('>') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('arg') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + PsiElement(QUEST)('?') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('block') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(RPAR)(')') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace('\n ') + PsiElement(contract)('contract') + PsiWhiteSpace(' ') + CONTRACT_EFFECT_LIST + PsiElement(LBRACKET)('[') + PsiWhiteSpace('\n ') + CONTRACT_EFFECT + BINARY_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('returns') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('implies') + PsiWhiteSpace(' ') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('arg') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EXCLEQ)('!=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + CONTRACT_EFFECT + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('callsInPlace') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('block') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('EXACTLY_ONCE') + PsiElement(RPAR)(')') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + PsiElement(RBRACKET)(']') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('MyClass') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('MyOtherClass') + PsiWhiteSpace('\n') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('block') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('arg') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(ELVIS)('?:') + PsiWhiteSpace(' ') + THROW + PsiElement(throw)('throw') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('NullArgumentException') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('some string') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('anotherFunctionWithTypeConstraints') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('D') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('data') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('D') + PsiElement(QUEST)('?') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('arg') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(QUEST)('?') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('block') + PsiElement(COLON)(':') + 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') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('D') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('SuperType') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('SomeType') + PsiWhiteSpace('\n ') + PsiElement(contract)('contract') + PsiWhiteSpace(' ') + CONTRACT_EFFECT_LIST + PsiElement(LBRACKET)('[') + PsiWhiteSpace('\n ') + CONTRACT_EFFECT + BINARY_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('returns') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('implies') + PsiWhiteSpace(' ') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('data') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EXCLEQ)('!=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + CONTRACT_EFFECT + BINARY_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('returns') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('implies') + PsiWhiteSpace(' ') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('arg') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EXCLEQ)('!=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACKET)(']') + PsiWhiteSpace('\n') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('require') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('data') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EXCLEQ)('!=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('require') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('arg') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EXCLEQ)('!=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('block') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java index 47fc3526d59..0e6430d93e6 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java @@ -385,16 +385,16 @@ public class ParsingTestGenerated extends AbstractParsingTest { runTest("compiler/testData/psi/FunctionWithMultilineContract.kt"); } - @TestMetadata("FunctionWithTypeConstraintsAndContract.kt") - public void testFunctionWithTypeConstraintsAndContract() throws Exception { - runTest("compiler/testData/psi/FunctionWithTypeConstraintsAndContract.kt"); - } - @TestMetadata("Functions.kt") public void testFunctions() throws Exception { runTest("compiler/testData/psi/Functions.kt"); } + @TestMetadata("FunctionsWithTypeConstraintsAndContract.kt") + public void testFunctionsWithTypeConstraintsAndContract() throws Exception { + runTest("compiler/testData/psi/FunctionsWithTypeConstraintsAndContract.kt"); + } + @TestMetadata("FunctionsWithoutName.kt") public void testFunctionsWithoutName() throws Exception { runTest("compiler/testData/psi/FunctionsWithoutName.kt");