Skip to content

Conversation

@som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jan 5, 2026

Fixes #24894
Fixes #21881

Annotation args can be inline transparent, but Inlining phase doesn't inline into annotations.

The Inlined node must be handled when emitting the annotation and also when inspecting args.

Take a final val alias of a Java enum as a transparent inline def to preserve semantics.

Take @elidable(0) to mean "do not erase", as seen on chalkboards and whiteboards.

@som-snytt som-snytt force-pushed the issue/24894-quoted-annot-array-arg branch from 4ddaa6c to df47c10 Compare January 6, 2026 00:05
@som-snytt som-snytt force-pushed the issue/24894-quoted-annot-array-arg branch from 72117fd to ebae84c Compare January 7, 2026 16:27
@som-snytt
Copy link
Contributor Author

som-snytt commented Jan 7, 2026

I'm glad the checks are green, but I had a local failure that final val was no longer stable in a pattern. I tossed in some StableRealizable and UncheckedStableAnnot but apparently that is not necessary. Probably I had a stale binary in .ivy2.

I wonder if there's a way for the test rig to warn me if a failure includes a suspicious artifact.

At the moment:

[error] -- [E046] Cyclic Error: /home/amarki/projects/scala3/staging/test/scala/quoted/staging/repl/StagingScriptedReplTests.scala:11:39
[error] 11 |class StagingScriptedReplTests extends ReplTest(ReplTest.withStagingOptions) {
[error]    |                                       ^
[error]    |                             Cyclic reference involving val <import>

I'm not going to investigate, but it would be nice if the test suite just ran (locally). Elsewhere, a PR includes tweaks to help run under JDK 25. Spurious warnings and errors are demoralizing and distracting.

I'll add a simple test for the stability check in patterns. (Bootstrapping would fail, as it did for me spuriously, if that were broken. It complained about the vals in concurrent.duration which are aliases of Java enums.) I'll also ask myself why it doesn't need more help with stability. The check is checkLegalValue in typer.

@som-snytt som-snytt marked this pull request as ready for review January 7, 2026 18:47
@som-snytt som-snytt requested a review from a team as a code owner January 7, 2026 18:47
@Gedochao Gedochao requested a review from jchyb January 8, 2026 14:55
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.

Inline not considered for annotation parameters even if macro returns constant expression Final val of Java enum is not a constant value

2 participants