Skip to content

KSP: skip root-package declarations with a warning (#319) - #325

Merged
b-re-w merged 1 commit into
developfrom
feat/ksp-root-package
Oct 25, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/ksp-root-package

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 25, 2026

Copy link
Copy Markdown
Member

Closes #319

  • Cause: Kotlin cannot refer to a root-package declaration from a named package, and every generated fragment and table is in one. qualifiedName.substringBeforeLast('.') also returned the function's own name as its 'package', so the generated call was unqualified and the consumer's compile failed.
  • Fix: FragmentScanner skips root-package functions, properties and classes. KSP warns with the declaration's name and the remedy (add a package). Nothing that worked before changes, since the build previously failed.
  • Test: the app fixture gains RootPackageDeclarations.kt (no package). RootPackageSkipTest checks that neither declaration is in the table. With the old scanner the fixture does not compile (red). With the fix, ksp fixtures:app desktopTest passes 80/80, the two warnings are printed, and the app's androidNative compile passes.

…itting an unresolved call (#319)

Kotlin cannot name a root-package declaration from a named package, and every generated fragment
lives in one: a public top-level function with no package produced 'Unresolved reference' and broke
the consumer's compile. The processor now warns, naming the declaration and the fix (add a package),
and skips it.
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