Skip to content

Commit

Permalink
from 1.9.20-Beta2 up to 1.9.30-dev-3330
Browse files Browse the repository at this point in the history
  • Loading branch information
apatrida committed Sep 26, 2023
1 parent 01d3d0b commit d8a31f1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ annotation class Meta {
newElement: FirFunctionCall
): FirCall {
val args = newElement.arguments
val argsApplied = args.mapIndexed { n, expr -> "args[$n] as ${+expr.typeRef}" }
val argsApplied = args.mapIndexed { n, expr -> "args[$n] as ${+expr.resolvedType}" }
val name = newElement.toResolvedCallableSymbol()?.callableId?.asSingleFqName()?.asString()

return compile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.extensions.MemberGenerationContext
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.types.coneType
import org.jetbrains.kotlin.fir.types.renderReadableWithFqNames
Expand Down Expand Up @@ -128,6 +129,9 @@ abstract class FirMetaContext(
?: source?.text?.toString()
?: error("$this has no source psi text element")

operator fun ConeKotlinType.unaryPlus(): String =
type.renderReadableWithFqNames().replace("/", ".")

val String.call: FirCall
get() =
compile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,27 @@ class TemplateCompiler(
fun convertToIR(metaCheckerContext: FirMetaCheckerContext?, firResult: FirResult, moduleConfiguration: CompilerConfiguration): Fir2IrActualizedResult {
val diagnosticReporter = DiagnosticReporterFactory.createPendingReporter()
val fir2IrExtensions = JvmFir2IrExtensions(moduleConfiguration, JvmIrDeserializerImpl(), JvmIrMangler)
val linkViaSignatures = moduleConfiguration.getBoolean(JVMConfigurationKeys.LINK_VIA_SIGNATURES)
val scopeFiles = firResult.scopeDeclarations.filterIsInstance<FirFile>()
val files = firResult.files + scopeFiles
val validatedFirResult = with(firResult) {
org.jetbrains.kotlin.fir.pipeline.FirResult(listOf(
ModuleCompilerAnalyzedOutput(session = session, scopeSession = scopeSession, fir = files)
))
org.jetbrains.kotlin.fir.pipeline.FirResult(
listOf(
ModuleCompilerAnalyzedOutput(session = session, scopeSession = scopeSession, fir = files)
)
)
}

val fir2IrConfiguration = Fir2IrConfiguration(
languageVersionSettings = moduleConfiguration.languageVersionSettings,
diagnosticReporter = diagnosticReporter,
linkViaSignatures = linkViaSignatures,
linkViaSignatures = moduleConfiguration.getBoolean(JVMConfigurationKeys.LINK_VIA_SIGNATURES),
evaluatedConstTracker = moduleConfiguration
.putIfAbsent(CommonConfigurationKeys.EVALUATED_CONST_TRACKER, EvaluatedConstTracker.create()),
inlineConstTracker = moduleConfiguration[CommonConfigurationKeys.INLINE_CONST_TRACKER],
// TODO: read notes on this flag
allowNonCachedDeclarations = false
// TODO: read notes on these new flags
allowNonCachedDeclarations = false,
// TODO: see KT-61514
useIrFakeOverrideBuilder = moduleConfiguration.getBoolean(CommonConfigurationKeys.USE_IR_FAKE_OVERRIDE_BUILDER)
)

val fir2IrResult = validatedFirResult.convertToIrAndActualizeForJvm(
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
arrowGradleConfig = "0.11.0"
classgraph = "4.8.154"
kotlin = "1.9.20-Beta2"
kotlin = "1.9.30-dev-3330"
reflections = "0.10.2"

[libraries]
Expand Down
4 changes: 2 additions & 2 deletions sandbox/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotlinVersion = "1.9.20-Beta2"
val kotlinVersion = "1.9.30-dev-3330"

plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.20-Beta2"
id("org.jetbrains.kotlin.jvm") version "1.9.30-dev-3330"
id("io.arrow-kt.reflect") version "0.1.0"
application
}
Expand Down
2 changes: 1 addition & 1 deletion sandbox/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
arrowGradleConfig = "0.11.0"
classgraph = "4.8.154"
kotlin = "1.9.20-Beta2"
kotlin = "1.9.30-dev-3330"
reflections = "0.10.2"

[libraries]
Expand Down

0 comments on commit d8a31f1

Please sign in to comment.