Skip to content

Encode path of class #23503

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

Fixes #22866

TastyFileUtil.getClassName [sic] encodes its path result so that a.b is not taken as two segments.

@som-snytt som-snytt force-pushed the issue/22866-dotted-name-doc branch from 4e7430f to 31c5b75 Compare July 11, 2025 13:54
@som-snytt
Copy link
Contributor Author

(Temporarily?) exclude a test from best effort neg, where the test file has a hyphen.

Under JDK 23, a bootstrap error at TypeApplications.typeParams where the exception handler

    catch {
      case ex: Throwable => handleRecursive("type parameters of", self.show, ex)
    }

must spin up a by-name for the self.show arg. Maybe it happens to be out of stack or something.

There is also a long-running test in that group, also under JDK 23, but vulpix doesn't report test names (is there a verbose option?). The kill -3 says

``` at dotty.tools.dotc.core.MatchReducer.recur$2(TypeComparer.scala:3921) at dotty.tools.dotc.core.MatchReducer.op$proxy90$1(TypeComparer.scala:3940) at dotty.tools.dotc.core.MatchReducer.matchCases(TypeComparer.scala:3940) at dotty.tools.dotc.core.Types$MatchType.reduced$$anonfun$1(Types.scala:5239) at dotty.tools.dotc.core.Types$MatchType$$Lambda/0x00007102ef654f80.apply(Unknown Source) at dotty.tools.dotc.core.TypeComparer.inSubComparer(TypeComparer.scala:3311) at dotty.tools.dotc.core.TypeComparer.reduceMatchWith(TypeComparer.scala:3322) at dotty.tools.dotc.core.TypeComparer$.reduceMatchWith(TypeComparer.scala:3533) at dotty.tools.dotc.core.Types$MatchType.reduced(Types.scala:5239) at dotty.tools.dotc.core.Types$Type.tryNormalize(Types.scala:1593) at dotty.tools.dotc.core.Types$Type.normalized(Types.scala:1587) at dotty.tools.dotc.core.Types$MatchType.reduced$$anonfun$1(Types.scala:5239) at dotty.tools.dotc.core.Types$MatchType$$Lambda/0x00007102ef654f80.apply(Unknown Source) at dotty.tools.dotc.core.TypeComparer.inSubComparer(TypeComparer.scala:3311) at dotty.tools.dotc.core.TypeComparer.reduceMatchWith(TypeComparer.scala:3322) at dotty.tools.dotc.core.TypeComparer$.reduceMatchWith(TypeComparer.scala:3533) at dotty.tools.dotc.core.Types$MatchType.reduced(Types.scala:5239) at dotty.tools.dotc.core.Types$Type.tryNormalize(Types.scala:1593) at dotty.tools.dotc.core.Types$AppliedType.tryNormalize(Types.scala:4709) at dotty.tools.dotc.core.TypeOps$.simplify(TypeOps.scala:152) at dotty.tools.dotc.core.Types$Type.simplified(Types.scala:2101) at dotty.tools.dotc.core.MatchReducer.recur$2(TypeComparer.scala:3921) at dotty.tools.dotc.core.MatchReducer.op$proxy90$1(TypeComparer.scala:3940) ```

As a branding note, it would have been great if betasty were spelled beasty.

@som-snytt
Copy link
Contributor Author

som-snytt commented Jul 11, 2025

The JDK 23 failure is negTestFromBestEffortTasty/neg/i9299, looking way down the exception trace, is not very enlightening.

Caused by: java.lang.BootstrapMethodError: java.lang.BootstrapMethodError: bootstrap method initialization exception
        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:501)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:485)
        at java.base/java.util.concurrent.ForkJoinTask.getException(ForkJoinTask.java:555)
        ... 44 more

I guess it is stack.

java.lang.NoClassDefFoundError: Could not initialize class java.lang.StackTraceElement$HashedModules

The test is an erroneous match type, so maybe it is related to the long-running test; for some reason it passes JDK 17 not 23.

Exiting right away shows

OpenJDK 64-Bit Server VM warning: Potentially dangerous stack overflow in ReservedStackAccess annotated method jdk.internal.misc.InternalLock.lock()V [1]
EX class java.lang.StackOverflowError

They say don't try to recover from SOE but we don't believe them.

Maybe there is a JVM-specific dimension, besides default stack size or whatever.

@som-snytt
Copy link
Contributor Author

If you propagate the SOE, you are SOL and vulpix hangs.

        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:196)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:210)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:196)
        at dotty.tools.dotc.core.TypeApplications$.typeParamSymbols$extension(TypeApplications.scala:238)
        at dotty.tools.dotc.typer.Typer.adaptType$1(Typer.scala:4851)
        at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4982)
        at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:4216)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3836)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3841)
        at dotty.tools.dotc.typer.Typer.typedMatchTypeTree(Typer.scala:2730)
***
        at dotty.tools.dotc.Driver.process(Driver.scala:169)
        at dotty.tools.vulpix.ParallelTesting$Test.compile(ParallelTesting.scala:564)
        at dotty.tools.vulpix.ParallelTesting$CompilationLogic.compileTestSource$$anonfun$1(ParallelTesting.scala:252)
        at scala.util.Try$.apply(Try.scala:217)
        at dotty.tools.vulpix.ParallelTesting$CompilationLogic.dotty$tools$vulpix$ParallelTesting$CompilationLogic$$compileTestSource(ParallelTesting.scala:264)
        at dotty.tools.vulpix.ParallelTesting$$anon$3.checkTestSource$$anonfun$1(ParallelTesting.scala:295)
        at dotty.tools.vulpix.ParallelTesting$$anon$3.checkTestSource$$anonfun$adapted$1(ParallelTesting.scala:298)
        at scala.Function0.apply$mcV$sp(Function0.scala:42)
        at dotty.tools.vulpix.ParallelTesting$Test.tryCompile(ParallelTesting.scala:482)
        at dotty.tools.vulpix.ParallelTesting$$anon$3.checkTestSource(ParallelTesting.scala:298)
        at dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run(ParallelTesting.scala:378)
        at dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run$(ParallelTesting.scala:360)
        at dotty.tools.vulpix.ParallelTesting$$anon$3.run(ParallelTesting.scala:293)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedInterruptibleRunnable.compute(ForkJoinTask.java:1709)
        at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1641)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1460)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2036)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189)
^C
[warn] Canceling execution...

I didn't expect that.

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.

The doctool has trouble with files named .test.scala containing top-level @main function
1 participant