Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Skip over JEP 445 compact compilation units#11066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lrytz wants to merge1 commit intoscala:2.13.x
base:2.13.x
Choose a base branch
Loading
fromlrytz:b12878

Conversation

lrytz
Copy link
Member

@lrytzlrytz commentedMay 22, 2025
edited by som-snytt
Loading

Compact compilation units are not referenceable, so we can skip over them.

Fixesscala/bug#12878

Copy link
Contributor

@som-snyttsom-snytt left a comment

Choose a reason for hiding this comment

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

There is a Peanuts cartoon (as I recall from childhood) in which Linus explains that when he's reading the Bible and encounters a word he doesn't know, he just "bloops right over it".

//> using javacOpt --enable-preview --release 21

int k = 0;
// This should work as compact units have an implicit `import module java.base`, but that doesn't seem to be the case with Java 21 preview
Copy link
Contributor

Choose a reason for hiding this comment

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

could use 25 directly, as no one cares about regression on old preview

Copy link
Contributor

Choose a reason for hiding this comment

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

I recognize you might wish to see it run and pass today, however.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Right, though we run 25 already on CI. I'll do that.

val ts = termDecl(mods, CLASS)
if (ts.nonEmpty) compact = true
Nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I might have generalizedtypeDeclOrCompactTerm(mods)(orElse: Tree) whichtypeDecl would call.

I might have orElse throw here to long jump back to a try in compilationUnit.

That would be to avoid listing tokens at L1097. OTOH, the method is so small this is fine.

There is areturn in thatinteractive code, so maybe I have early return on the brain.

@som-snytt
Copy link
Contributor

TILreferrible, in OED viahttps://english.stackexchange.com/questions/51527/use-of-the-word-referable

OED notes intransitive "reference" having to do with (I think) cataloguing properties which must be acquired by eminent domain for a railroad. That strikes me as a very British coinage, that is, putting that disruptive practice behind a neutral term that doesn't even take a direct object. In the U.S., it's just called capitalism.

To make too fine a distinction, does "reference" imply authoritative reference? Then one could reference a stable reference (in our terminology). Or perhaps conversely, every reference in computing is authoritative to mean correct and not erroneous, and therefore can be referenced.

From C pointer days, we would say "dereference" for this action of actually finding the referent. That is at runtime.

That might imply that at compiletime, one does not reference simply any identifier, but only identifiers with the strongest guarantees (that they are not null, perhaps).

The weak sense is that referrible means in the namespace and accessible.

Compact compilation units are not referencable, so we can skip overthem.
@SethTisueSethTisue added the release-notesworth highlighting in next release notes labelMay 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@som-snyttsom-snyttsom-snytt approved these changes

Assignees
No one assigned
Labels
release-notesworth highlighting in next release notes
Projects
None yet
Milestone
2.13.17
Development

Successfully merging this pull request may close these issues.

JavaParsers doesn't supportJEP 445: Unnamed Classes and Instance Main Methods
4 participants
@lrytz@som-snytt@SethTisue@scala-jenkins

[8]ページ先頭

©2009-2025 Movatter.jp