Repository navigation
docs: fix the README sample, and refresh version examples before they ship - #8
Merged
Merged
Conversation
… ship
Two unrelated doc defects, both found by a pre-tag audit, both worth fixing before 0.0.7 is
published rather than after.
README's first Java sample did not compile. It opens with `import io.github.refux.slang.*;`,
and java.lang.Module is implicitly on-demand imported too, so `Module module = ...` is
ambiguous:
error: reference to Module is ambiguous
both class io.github.refux.slang.Module in io.github.refux.slang
and class java.lang.Module in java.lang match
Not a regression from the Slang bump -- it has been wrong since the consumer-facing README
was written -- but it is the first code anyone runs. Verified by extracting the block from
README.md and compiling it against the real 0.0.7 jar, with and without the added import:
the error above without, clean with.
The javadoc examples matter for a narrower reason: they ship inside slang-java-0.0.7-
javadoc.jar to Maven Central, which cannot be replaced once released, so a stale example is
permanently stale for this version. GlobalSession#buildTagString and
SlangNative#spGetBuildTagString both illustrated "2026.13"; they now say "2026.14.1", which
also stops the example under-representing the real tag, now three components rather than
two. SlangLibrary's versioned-filename fallback illustrated
libslang-compiler.0.2026.13.dylib; it now names 0.2026.14.1, taken from
natives/manifests/macos-aarch64.json rather than invented.
ModuleInfo's `e.g. "2026.8"` is deliberately left alone. That field is the build tag of the
release that WROTE the IR, and an older writer than the running compiler is exactly the case
the surrounding javadoc is describing -- an example naming the current release would
illustrate the wrong thing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2026.1.3
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two unrelated documentation defects, both surfaced by a pre-tag audit of 0.0.7, both worth fixing before publication rather than after.
README's first Java sample did not compile
It opens with
import io.github.refux.slang.*;, andjava.lang.Moduleis implicitly on-demand imported too, soModule module = ...is ambiguous:Not a regression from the Slang bump — it has been wrong since the consumer-facing README was written — but it is the first code anyone runs against this library.
Verified in both directions by extracting the block straight out of
README.mdand compiling it against the real 0.0.7 jar: the error above without the added import, clean with it.Stale version examples in the published javadoc
These matter for a narrow but unforgiving reason: they ship inside
slang-java-0.0.7-javadoc.jarto Maven Central, which cannot be replaced once released. A stale example is then permanently stale for this version.GlobalSession#buildTagStringe.g. "2026.13"e.g. "2026.14.1"SlangNative#spGetBuildTagStringe.g. "2026.13"e.g. "2026.14.1"SlangLibraryversioned-filename fallbacklibslang-compiler.0.2026.13.dyliblibslang-compiler.0.2026.14.1.dylibThe two build-tag examples also stop under-representing the real tag, which is now three components rather than two — a detail that matters for anyone parsing it. The dylib name is taken from
natives/manifests/macos-aarch64.jsonrather than invented, so it is a filename that genuinely ships.One flagged example deliberately left alone
The audit also flagged
ModuleInfo's@param compilerVersion … e.g. "2026.8". That one is correct as it stands: the field is the build tag of the release that wrote the IR, and an older writer than the running compiler is precisely the case the surrounding javadoc is describing. An example naming the current release would illustrate the wrong thing.Verification
javacagainst the real jar for the README block (both with and without the fix), and:slang:javadocbuilds clean. No2026.13remains in any hand-written source.🤖 Generated with Claude Code