Skip to content

Conversation

@som-snytt
Copy link
Contributor

Fixes #24457

Record type of apply.

@som-snytt
Copy link
Contributor Author

Scala 2 does a tree traversal and considers every tree type.

Probably it's time to refactor linting to drop miniphase. Maybe just this check can do a custom traversal; or more ambitiously, lints can be composed but more efficiently than miniphase. Lints by definition do not transform.

@som-snytt som-snytt force-pushed the issue/24457-unused-private-leaks-inline branch 2 times, most recently from 4e93233 to 292fe54 Compare November 18, 2025 00:16
@som-snytt
Copy link
Contributor Author

flaky test:

[info] Test dotty.tools.debug.DebugTests.debug started
Exception thrown onComplete (probably by a reporter) in tests/debug/eval-local-class.scala: class java.io.IOException
java.io.IOException: Failed getting JDI port of child JVM: got ERROR: transport error 202: send failed: Broken pipe
	at dotty.tools.vulpix.RunnerOrchestration$RunnerMonitor$RunnerProcess.getJdiPort(RunnerOrchestration.scala:113)
	at dotty.tools.vulpix.RunnerOrchestration$$anon$1.readJdiPort(RunnerOrchestration.scala:144)
	at dotty.tools.debug.DebugTests$DebugTest.verifyDebug$$anonfun$1(DebugTests.scala:60)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at dotty.tools.vulpix.RunnerOrchestration$RunnerMonitor$Runner.debugMain(RunnerOrchestration.scala:149)
	at dotty.tools.vulpix.RunnerOrchestration.dotty$tools$vulpix$RunnerOrchestration$RunnerMonitor$$_$debugMain$$anonfun$1(RunnerOrchestration.scala:93)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at dotty.tools.vulpix.RunnerOrchestration$RunnerMonitor.withRunner(RunnerOrchestration.scala:237)
	at dotty.tools.vulpix.RunnerOrchestration$RunnerMonitor.debugMain(RunnerOrchestration.scala:93)
	at dotty.tools.vulpix.RunnerOrchestration.debugMain(RunnerOrchestration.scala:72)
	at dotty.tools.vulpix.RunnerOrchestration.debugMain$(RunnerOrchestration.scala:38)
	at dotty.tools.debug.DebugTests$.debugMain(DebugTests.scala:24)
	at dotty.tools.debug.DebugTests$DebugTest.verifyDebug(DebugTests.scala:74)
	at dotty.tools.debug.DebugTests$DebugTest.onSuccess(DebugTests.scala:50)
	at dotty.tools.vulpix.ParallelTesting$CompilationLogic.dotty$tools$vulpix$ParallelTesting$CompilationLogic$$onComplete(ParallelTesting.scala:311)
	at dotty.tools.vulpix.ParallelTesting$$anon$3.checkTestSource$$anonfun$1(ParallelTesting.scala:298)
	at dotty.tools.vulpix.ParallelTesting$$anon$3.checkTestSource$$anonfun$adapted$1(ParallelTesting.scala:300)
	at scala.Function0.apply$mcV$sp(Function0.scala:45)
	at dotty.tools.vulpix.ParallelTesting$Test.tryCompile(ParallelTesting.scala:484)
	at dotty.tools.vulpix.ParallelTesting$$anon$3.checkTestSource(ParallelTesting.scala:300)
	at dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run(ParallelTesting.scala:380)
	at dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run$(ParallelTesting.scala:362)
	at dotty.tools.vulpix.ParallelTesting$$anon$3.run(ParallelTesting.scala:295)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1375)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Error:  Test dotty.tools.debug.DebugTests.debug failed: java.lang.AssertionError: Debug test failed, but should not, reasons:
Error:  encountered 1 test failure(s):
Error:    - generic failure (see test output), took 32.689 sec
Error:      at dotty.tools.vulpix.ParallelTesting$CompilationTest.checkPass(ParallelTesting.scala:1271)
Error:      at dotty.tools.debug.DebugTests$.dotty$tools$debug$DebugTests$$$checkDebug(DebugTests.scala:44)
Error:      at dotty.tools.debug.DebugTests.debug(DebugTests.scala:22)
Error:      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
Error:      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error:      at java.lang.reflect.Method.invoke(Method.java:569)
Error:      ...

================================================================================
Test Report
================================================================================

0 suites passed, 1 failed, 1 total
    tests/debug/eval-local-class.scala failed

and

Error:  All tests passed after retry, indicating that some tests are flaky.
Error:  This build is configured to reject flaky tests.
Error:  Failed: Total 553, Failed 0, Errors 0, Passed 544, Skipped 9, Ignored 8
Error:  (scala3-compiler-bootstrapped-new / Test / testOnly) sbt.TestsFailedException: Tests unsuccessful
Error:  Total time: 3412 s (0:56:52.0), completed Nov 17, 2025, 10:04:46 PM
Error: Process completed with exit code 1.

@som-snytt som-snytt force-pushed the issue/24457-unused-private-leaks-inline branch from 292fe54 to e258c87 Compare November 18, 2025 00:23
@som-snytt som-snytt marked this pull request as ready for review November 18, 2025 03:20
@Gedochao Gedochao added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 18, 2025
@Gedochao Gedochao added this to the 3.8.0 milestone Nov 18, 2025
@Gedochao Gedochao requested a review from tgodzik November 18, 2025 11:12
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgodzik tgodzik merged commit 656f2c5 into scala:main Nov 18, 2025
45 checks passed
@som-snytt som-snytt deleted the issue/24457-unused-private-leaks-inline branch November 18, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive unused for class only used by calling companion apply

3 participants