Skip to content

[Tests][JS] Don't use codegen helpers for JS diagnostic tests#6531

Open
Vladimir Sukharev (vsukharev) wants to merge 1 commit into
masterfrom
rr/sukharev/KT-85764-dont-use-codegen-helpers-in-JS-diagnostic-tests
Open

[Tests][JS] Don't use codegen helpers for JS diagnostic tests#6531
Vladimir Sukharev (vsukharev) wants to merge 1 commit into
masterfrom
rr/sukharev/KT-85764-dont-use-codegen-helpers-in-JS-diagnostic-tests

Conversation

@vsukharev

@vsukharev Vladimir Sukharev (vsukharev) commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Don't use codegen helpers for JS diagnostic tests,
otherwise, KOTLIN_PACKAGE_USAGE error diagnostic will be raised for helpers fail.kt, asserts.kt, arrayAsserts.kt, which contain line package kotlin, which is

  • recently prohibited in ^KT-85764
  • not needed for diagnostic tests

Rationale: in master, JsDiagnosticsWithIrInlinerTestGenerated, LightTreeJsKlibDiagnosticsTestGenerated and PsiJsKlibDiagnosticsTestGenerated are red with messages

KOTLIN_PACKAGE_USAGE: Only the Kotlin standard library is allowed to use the 'kotlin' package. at fail.kt:(0,14)

It isn't shown in Aggregate CI, due to exclusion of JS ES5 tests from Aggregate CI, in scope of
KTI-3244 Duty (18 May - 24 May) .
See

Due to absence in Aggregate, these testrunners were overlooked in scope of ^KT-85764.
This PR fixes them by removing the following codegen helpers from JS diagnostic tests, and adding them only to JS codegen tests:

  • JsAdditionalSourceProvider
  • CoroutineHelpersSourceFilesProvider

On the way, abstract classes for ES6 codegen tests were streamlined

Note: As next steps, it worth returning ES5 testrunners to Aggregate CI, due to upcoming 2.4.20-Beta2 branching.

^KT-85764

@kotlin-safemerge

kotlin-safemerge Bot commented Jul 5, 2026

Copy link
Copy Markdown

Code Owners

RuleOwnersApproval
/​js/​
kotlin-js

UNASSIGNED
/​js/​js.​translator/​testData/​
kotlin-js
kotlin-wasm

UNASSIGNED

otherwise, KOTLIN_PACKAGE_USAGE error diagnostic will be raised for helpers fail.kt, asserts.kt, arrayAsserts.kt,

^KT-85764
@vsukharev Vladimir Sukharev (vsukharev) force-pushed the rr/sukharev/KT-85764-dont-use-codegen-helpers-in-JS-diagnostic-tests branch from 3eb9ce4 to aa6f6dd Compare July 5, 2026 20:57

// Adapter should be initialized eagerly
@Suppress("INVISIBLE_MEMBER")
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")

@vsukharev Vladimir Sukharev (vsukharev) Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suppress is now needed due to added NoFirCompilationErrorsHandler via commonFirHandlersForCodegenTest()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant