Fix "<" or ">" in member name leading to exception

This commit is contained in:
Pavel V. Talanov
2016-02-11 14:33:16 +03:00
parent 69afc2316d
commit 47ceb106c7
4 changed files with 6 additions and 8 deletions
@@ -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
@@ -63,7 +63,7 @@ abstract class KtNamedDeclarationStub<T extends KotlinStubWithFqName<?>> extends
@Override
public Name getNameAsName() {
String name = getName();
return name != null ? Name.guess(name) : null;
return name != null ? Name.identifier(name) : null;
}
@Override
+2 -6
View File
@@ -34,16 +34,12 @@ val <!INVALID_CHARACTERS!>`val\X`<!> = 10
val <!INVALID_CHARACTERS!>`;`<!> = 1
val <!INVALID_CHARACTERS!>`[`<!> = 2
val <!INVALID_CHARACTERS!>`]`<!> = 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 <!INVALID_CHARACTERS!>`<`<!> = 4
val <!INVALID_CHARACTERS!>`>`<!> = 5
val <!INVALID_CHARACTERS!>`:`<!> = 6
val <!INVALID_CHARACTERS!>`\`<!> = 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 <!INVALID_CHARACTERS!>`<>`<!> = 8
val <!INVALID_CHARACTERS!>`[]`<!> = 9
val <!INVALID_CHARACTERS!>`[;]`<!> = 10
+2
View File
@@ -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