typesafegithub / typesafegithub/github-workflows-kt

`Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl`

Open
#2,348 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

problem
Dominant language
Kotlin
Stars
664
Forks
30
Avg merge
4d 19h
Merged PRs (30d)
5

Description

Component

Action

Just run CI for this project - looking at the step, it's about compiling the script: https://github.com/typesafegithub/github-workflows-kt/actions/runs/27213769566/job/80485705899

Expected

Succeeds.

Actual

Fails with

error: while analysing .github/workflows/end-to-end-tests.main.kts:37:5: org.jetbrains.kotlin.utils.exceptions.KotlinIllegalArgumentExceptionWithAttachments: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl (end-to-end-tests.main.kts): org.jetbrains.kotlin.util.FileAnalysisException: While analysing .github/workflows/end-to-end-tests.main.kts:37:5: org.jetbrains.kotlin.utils.exceptions.KotlinIllegalArgumentExceptionWithAttachments: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl

Most likely related to a bug in Kotlin 2.4.0, see KT-86352. Slack thread: https://kotlinlang.slack.com/archives/C0BT46EL8/p1780927673531079?thread_ts=1773078486.658489&cid=C0BT46EL8

Workaround, if exists

In your workflow, add:

@file:DependsOn("fwilhe2:setup-kotlin:v1")

import io.github.typesafegithub.workflows.actions.fwilhe2.SetupKotlin

// ...

workflow(
    // ...
    consistencyCheckJobConfig = DEFAULT_CONSISTENCY_CHECK_JOB_CONFIG.copy(
        // ...
        additionalSteps = {
            uses(
                name = "Downgrade Kotlin",
                action = SetupKotlin(
                    // One version before 2.4.0 that contains a bug leading to this failure:
                    //   While analysing .github/workflows/build.main.kts:53:13:
                    //   org.jetbrains.kotlin.utils.exceptions.KotlinIllegalArgumentExceptionWithAttachments:
                    //   Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl
                    // This downgrade is meant to be a temporary workaround.
                    version = "2.3.21",
                ),
            )
        },
    ),

Example PR: https://github.com/typesafegithub/github-workflows-kt/pull/2350

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CI run and .github/workflows/end-to-end-tests.main.kts, especially line 37. Compare the Kotlin 2.4.0 failure with the documented 2.3.21 workaround, then review KT-86352 and PR #2350. Done means the workflow compiles and CI succeeds without the reported FIR error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, kotlin
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.