[FIR] Throws by star import wins builtin Throws, ^KT-52407 Fixed, ^KT-52517 Fixed
This commit is contained in:
+6
@@ -34414,6 +34414,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("throwsByStarWinsBuiltin.kt")
|
||||||
|
public void testThrowsByStarWinsBuiltin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throwsByStarWinsBuiltin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TransientOnDelegate.kt")
|
@TestMetadata("TransientOnDelegate.kt")
|
||||||
public void testTransientOnDelegate() throws Exception {
|
public void testTransientOnDelegate() throws Exception {
|
||||||
|
|||||||
+6
@@ -34414,6 +34414,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("throwsByStarWinsBuiltin.kt")
|
||||||
|
public void testThrowsByStarWinsBuiltin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throwsByStarWinsBuiltin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TransientOnDelegate.kt")
|
@TestMetadata("TransientOnDelegate.kt")
|
||||||
public void testTransientOnDelegate() throws Exception {
|
public void testTransientOnDelegate() throws Exception {
|
||||||
|
|||||||
+6
@@ -34414,6 +34414,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("throwsByStarWinsBuiltin.kt")
|
||||||
|
public void testThrowsByStarWinsBuiltin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throwsByStarWinsBuiltin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TransientOnDelegate.kt")
|
@TestMetadata("TransientOnDelegate.kt")
|
||||||
public void testTransientOnDelegate() throws Exception {
|
public void testTransientOnDelegate() throws Exception {
|
||||||
|
|||||||
+9
-1
@@ -16,7 +16,7 @@ enum class DefaultImportPriority {
|
|||||||
languageVersionSettings: LanguageVersionSettings
|
languageVersionSettings: LanguageVersionSettings
|
||||||
): List<ImportPath>? =
|
): List<ImportPath>? =
|
||||||
platformDependentAnalyzerServices?.getDefaultImports(languageVersionSettings, includeLowPriorityImports = false)?.let {
|
platformDependentAnalyzerServices?.getDefaultImports(languageVersionSettings, includeLowPriorityImports = false)?.let {
|
||||||
it + ImportPath.fromString("kotlin.Throws")
|
it
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LOW {
|
LOW {
|
||||||
@@ -25,6 +25,14 @@ enum class DefaultImportPriority {
|
|||||||
languageVersionSettings: LanguageVersionSettings
|
languageVersionSettings: LanguageVersionSettings
|
||||||
): List<ImportPath>? =
|
): List<ImportPath>? =
|
||||||
platformDependentAnalyzerServices?.defaultLowPriorityImports
|
platformDependentAnalyzerServices?.defaultLowPriorityImports
|
||||||
|
},
|
||||||
|
KOTLIN_THROWS {
|
||||||
|
override fun getAllDefaultImports(
|
||||||
|
platformDependentAnalyzerServices: PlatformDependentAnalyzerServices?,
|
||||||
|
languageVersionSettings: LanguageVersionSettings
|
||||||
|
): List<ImportPath> {
|
||||||
|
return listOf(ImportPath.fromString("kotlin.Throws"))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
abstract fun getAllDefaultImports(
|
abstract fun getAllDefaultImports(
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ private fun doCreateImportingScopes(
|
|||||||
scopeSession.getOrBuild(DefaultStarImportKey(DefaultImportPriority.HIGH, excludedImportNames), DEFAULT_STAR_IMPORT) {
|
scopeSession.getOrBuild(DefaultStarImportKey(DefaultImportPriority.HIGH, excludedImportNames), DEFAULT_STAR_IMPORT) {
|
||||||
FirDefaultStarImportingScope(session, scopeSession, DefaultImportPriority.HIGH, excludedImportNames)
|
FirDefaultStarImportingScope(session, scopeSession, DefaultImportPriority.HIGH, excludedImportNames)
|
||||||
},
|
},
|
||||||
|
scopeSession.getOrBuild(DefaultImportPriority.KOTLIN_THROWS, DEFAULT_SIMPLE_IMPORT) {
|
||||||
|
FirDefaultSimpleImportingScope(session, scopeSession, priority = DefaultImportPriority.KOTLIN_THROWS)
|
||||||
|
},
|
||||||
FirExplicitStarImportingScope(file.imports, session, scopeSession, excludedImportNames),
|
FirExplicitStarImportingScope(file.imports, session, scopeSession, excludedImportNames),
|
||||||
|
|
||||||
scopeSession.getOrBuild(DefaultImportPriority.LOW, DEFAULT_SIMPLE_IMPORT) {
|
scopeSession.getOrBuild(DefaultImportPriority.LOW, DEFAULT_SIMPLE_IMPORT) {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ package abc7
|
|||||||
import kotlin.*
|
import kotlin.*
|
||||||
import kotlin.jvm.*
|
import kotlin.jvm.*
|
||||||
|
|
||||||
@Throws(Exception::class)
|
@<!OVERLOAD_RESOLUTION_AMBIGUITY!>Throws<!>(Exception::class)
|
||||||
fun foo1() {}
|
fun foo1() {}
|
||||||
|
|
||||||
@kotlin.Throws(Exception::class)
|
@kotlin.Throws(Exception::class)
|
||||||
@@ -121,7 +121,7 @@ fun foo2() {}
|
|||||||
@kotlin.jvm.Throws(Exception::class)
|
@kotlin.jvm.Throws(Exception::class)
|
||||||
fun foo3() {}
|
fun foo3() {}
|
||||||
|
|
||||||
fun foo5(x: Throws) {}
|
fun foo5(x: <!OVERLOAD_RESOLUTION_AMBIGUITY!>Throws<!>) {}
|
||||||
fun foo6(x: kotlin.Throws) {}
|
fun foo6(x: kotlin.Throws) {}
|
||||||
fun foo7(x: kotlin.jvm.Throws) {}
|
fun foo7(x: kotlin.jvm.Throws) {}
|
||||||
|
|
||||||
|
|||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// WITH_STDLIB
|
||||||
|
// ISSUE: KT-52407
|
||||||
|
|
||||||
|
// FILE: x.kt
|
||||||
|
|
||||||
|
package x
|
||||||
|
|
||||||
|
class Throws {
|
||||||
|
fun test() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
|
||||||
|
import x.*
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
Throws().test()
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
|
package x {
|
||||||
|
|
||||||
|
public final class Throws {
|
||||||
|
public constructor Throws()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public final fun test(): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -34504,6 +34504,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throws.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("throwsByStarWinsBuiltin.kt")
|
||||||
|
public void testThrowsByStarWinsBuiltin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/throwsByStarWinsBuiltin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TransientOnDelegate.kt")
|
@TestMetadata("TransientOnDelegate.kt")
|
||||||
public void testTransientOnDelegate() throws Exception {
|
public void testTransientOnDelegate() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user