Skip to content

Conversation

@som-snytt
Copy link
Contributor

@som-snytt som-snytt commented May 15, 2023

Fixes #17515

Regression test for the standard library Unit, ingested in Scala 3.

When unpickling a Scala 2 annotation argument, the annotation constructor is overloaded and the argument winds up adapted, "constant".asInstanceOf[String]. Strip the cast.

@som-snytt som-snytt closed this May 16, 2023
@som-snytt som-snytt reopened this May 16, 2023
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 4624695 to 897d7a7 Compare May 16, 2023 04:17
@som-snytt som-snytt closed this May 16, 2023
@som-snytt som-snytt reopened this May 16, 2023
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 897d7a7 to 4878939 Compare May 16, 2023 08:53
@som-snytt som-snytt marked this pull request as ready for review June 1, 2023 20:48
@som-snytt som-snytt marked this pull request as draft April 5, 2024 01:22
@som-snytt som-snytt closed this Sep 15, 2024
@som-snytt som-snytt reopened this Apr 14, 2025
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 4878939 to 86a3225 Compare April 14, 2025 15:11
@som-snytt som-snytt marked this pull request as ready for review April 14, 2025 15:13
@som-snytt
Copy link
Contributor Author

looks spurious

Test 'tests\run-tasty-inspector\i14785.scala' failed with output:               
List(out\runWithCompiler\run-tasty-inspector\i14785, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.16\scala-library-2.13.16.jar, C:\actions-runner2\_work\scala3\scala3\library\..\out\bootstrap\scala3-library-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-library_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.16\scala-library-2.13.16.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-asm\9.7.1-scala-1\scala-asm-9.7.1-scala-1.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\jline\jline-terminal\3.29.0\jline-terminal-3.29.0.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\jline\jline-reader\3.29.0\jline-reader-3.29.0.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\compiler-interface\1.10.7\compiler-interface-1.10.7.jar, C:\actions-runner2\_work\scala3\scala3\interfaces\target\scala3-interfaces-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\library\..\out\bootstrap\scala3-library-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-library_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\tasty\..\out\bootstrap\tasty-core-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\tasty-core_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\compiler\..\out\bootstrap\scala3-compiler-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-compiler_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\tasty-inspector\..\out\bootstrap\scala3-tasty-inspector\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-tasty-inspector_3-3.7.1-RC1-bin-SNAPSHOT.jar, out\runWithCompiler\run-tasty-inspector\i8389, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.16\scala-library-2.13.16.jar, C:\actions-runner2\_work\scala3\scala3\library\..\out\bootstrap\scala3-library-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-library_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.16\scala-library-2.13.16.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-asm\9.7.1-scala-1\scala-asm-9.7.1-scala-1.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\jline\jline-terminal\3.29.0\jline-terminal-3.29.0.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\jline\jline-reader\3.29.0\jline-reader-3.29.0.jar, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\compiler-interface\1.10.7\compiler-interface-1.10.7.jar, C:\actions-runner2\_work\scala3\scala3\interfaces\target\scala3-interfaces-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\library\..\out\bootstrap\scala3-library-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-library_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\tasty\..\out\bootstrap\tasty-core-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\tasty-core_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\compiler\..\out\bootstrap\scala3-compiler-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-compiler_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:\actions-runner2\_work\scala3\scala3\tasty-inspector\..\out\bootstrap\scala3-tasty-inspector\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-tasty-inspector_3-3.7.1-RC1-bin-SNAPSHOT.jar, out\runWithCompiler\run-tasty-inspector\isSuperAccessor, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.16\scala-library-2.13.16.jar, C:\actions-runner2\_work\scala3\scala3\library\..\out\bootstrap\scala3-library-bootstrapped\scala-3.7.1-RC1-bin-SNAPSHOT-nonbootstrapped\scala3-library_3-3.7.1-RC1-bin-SNAPSHOT.jar, C:

@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 86a3225 to ef2ffb8 Compare April 17, 2025 17:09
@som-snytt som-snytt marked this pull request as draft April 29, 2025 03:05
@som-snytt
Copy link
Contributor Author

This seems to be an artifact of compilation by Scala 2, either the way Scala 2 writes the attribute or the way Scala 3 unpickles it.

@som-snytt
Copy link
Contributor Author

I don't know yet if this is a separate issue:

4 |@implicitNotFound("nope": @nowarn)
  |                  ^^^^^^^^^^^^^^^
  |            @implicitNotFound requires constant expressions as a parameter

It compiles with 2 and is consumed correctly by 3.

@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch 2 times, most recently from 1cb905f to 8203c20 Compare August 3, 2025 07:28
@som-snytt som-snytt changed the title Accommodate quasi-constant annotation Accommodate adapted Scala 2 annotation value Aug 3, 2025
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 8203c20 to 49860db Compare November 6, 2025 20:52
@som-snytt som-snytt marked this pull request as ready for review November 6, 2025 22:41
@Gedochao Gedochao requested a review from odersky November 6, 2025 23:00
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 49860db to d93e631 Compare November 7, 2025 01:31
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from d93e631 to 4c8e007 Compare November 25, 2025 17:51
@som-snytt som-snytt force-pushed the issue/17515-CTO-Unit branch from 4c8e007 to 6788b36 Compare November 25, 2025 17:54
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

This must hold the record for longest outstanding review ending in a simple approval. Sorry about that! And amazing there no conflicts popped up in the meantime. @som-snytt If you have nothing to add this PR, please merge.

@odersky odersky removed their assignment Nov 28, 2025
@som-snytt som-snytt merged commit 7eab684 into scala:main Nov 28, 2025
45 checks passed
@som-snytt som-snytt deleted the issue/17515-CTO-Unit branch November 28, 2025 18:06
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.

Strangely omitted compileTimeOnly message for Unit companion

2 participants