diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationNotStubbed.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationNotStubbed.java index 9bc17a7d667..eeec6006d0e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationNotStubbed.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationNotStubbed.java @@ -48,7 +48,7 @@ abstract class KtNamedDeclarationNotStubbed extends KtDeclarationImpl implements @Override public Name getNameAsName() { String name = getName(); - return name != null ? Name.guess(name) : null; + return name != null ? Name.identifier(name) : null; } @Override diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationStub.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationStub.java index 0cb3f4be6d5..412f0e7d65c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationStub.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtNamedDeclarationStub.java @@ -63,7 +63,7 @@ abstract class KtNamedDeclarationStub> extends @Override public Name getNameAsName() { String name = getName(); - return name != null ? Name.guess(name) : null; + return name != null ? Name.identifier(name) : null; } @Override diff --git a/compiler/testData/diagnostics/tests/BacktickNames.kt b/compiler/testData/diagnostics/tests/BacktickNames.kt index 78c377a028d..30d3a4dee67 100644 --- a/compiler/testData/diagnostics/tests/BacktickNames.kt +++ b/compiler/testData/diagnostics/tests/BacktickNames.kt @@ -34,16 +34,12 @@ val `val\X` = 10 val `;` = 1 val `[` = 2 val `]` = 3 -// org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException: Descriptor wasn't found for declaration PROPERTY -// Names which start with '<' are treated as "special": see Name.java -//val `<` = 4 +val `<` = 4 val `>` = 5 val `:` = 6 val `\` = 7 -// org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException: Descriptor wasn't found for declaration PROPERTY -// Names which start with '<' are treated as "special": see Name.java -//val `<>` = 8 +val `<>` = 8 val `[]` = 9 val `[;]` = 10 diff --git a/compiler/testData/diagnostics/tests/BacktickNames.txt b/compiler/testData/diagnostics/tests/BacktickNames.txt index 48a812ce0ba..54eb7111d2f 100644 --- a/compiler/testData/diagnostics/tests/BacktickNames.txt +++ b/compiler/testData/diagnostics/tests/BacktickNames.txt @@ -2,6 +2,8 @@ package public val `:`: kotlin.Int = 6 public val `;`: kotlin.Int = 1 +public val `<`: kotlin.Int = 4 +public val `<>`: kotlin.Int = 8 public val `>`: kotlin.Int = 5 public val `[`: kotlin.Int = 2 public val `[;]`: kotlin.Int = 10