Fix StringIndexOutOfBoundsException
#EA-72837 Fixed
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun <T> g(x: T) = 1
|
||||
fun h(x: () -> Unit) = 1
|
||||
|
||||
fun foo() {
|
||||
<!UNRESOLVED_REFERENCE!>f<!>(::<!SYNTAX!><!>)
|
||||
g(::<!SYNTAX!><!>)
|
||||
h(::<!SYNTAX!><!>)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Unit
|
||||
public fun </*0*/ T> g(/*0*/ x: T): kotlin.Int
|
||||
public fun h(/*0*/ x: () -> kotlin.Unit): kotlin.Int
|
||||
@@ -11262,6 +11262,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ea72837.kt")
|
||||
public void testEa72837() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/ea72837.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ErrorsOnIbjectExpressionsAsParameters.kt")
|
||||
public void testErrorsOnIbjectExpressionsAsParameters() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/ErrorsOnIbjectExpressionsAsParameters.kt");
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class DecapitalizedAnnotationScope(override val workerScope: JetScope) :
|
||||
private fun findDecapitalizedAnnotation(name: Name, location: LookupLocation): ClassifierDescriptor? {
|
||||
val nameAsString = name.asString()
|
||||
|
||||
if (nameAsString[0].isUpperCase() || nameAsString !in DECAPITALIZED_SHORT_NAMES) return null
|
||||
if (nameAsString.length() == 0 || nameAsString[0].isUpperCase() || nameAsString !in DECAPITALIZED_SHORT_NAMES) return null
|
||||
val capitalizedIdentifier = Name.identifier(nameAsString.capitalize())
|
||||
|
||||
val capitalizedClassifier = getClassifier(capitalizedIdentifier, location) ?: return null
|
||||
|
||||
Reference in New Issue
Block a user