Drop the blanket Scala 2 caveat; report the real gap instead - #146
Open
rochala wants to merge 1 commit into
Open
Drop the blanket Scala 2 caveat; report the real gap instead#146rochala wants to merge 1 commit into
rochala wants to merge 1 commit into
Conversation
Every Scala 2 signature carried `// [Scala 2 — limited type information]`, appended on source language alone rather than on any evidence of loss — about 70 times in a single cats.data.NonEmptyList lookup. Measured it. Comparing scala-library 2.13.16 (pickles) against scala2-library-tasty-experimental_3 (the same stdlib recompiled to TASTy): 2878 signature lines over 76 symbols, 95.4% byte-identical after normalisation, and no case where the Scala 2 side lost a type the Scala 3 side had. Where they diverge the Scala 2 rendering is the better one more often than the worse (70 lines to 22), and the TASTy side is the one that failed to load 5 of 81 symbols. The real Scala 2 gap is documentation: pickles carry no Scaladoc, so 0 of 76 lookups had prose docs versus 70 of 76 from TASTy. So the per-signature caveat goes, and the once-per-response footer now states what is true. The README support table repeated the same inaccurate claim; corrected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem #4 from the printer review, backed by a measurement rather than an impression.
The problem
printSymbolSignatureSafeappended// [Scala 2 — limited type information]to every Scala 2 signature, keyed on source language alone — never on evidence that anything was lost. It fires ~70 times in onecats.data.NonEmptyListlookup, including ondef size: Int.The measurement
Compared
scala-library:2.13.16(pickles) againstscala2-library-tasty-experimental_3:3.7.4— the same standard library in two encodings, so the pairing is exact.2878 signature lines across 76 symbols. 95.4% byte-identical after normalisation. Zero cases where the Scala 2 side lost a type the Scala 3 side had.
Of the 132 differing lines:
SeqFactory[List]vsSeqFactory[[A] =>> List[A]])$default$Naccessors leakingtoString()vstoString)())So Scala 2 renders better roughly 70 lines to 22 — and the one category where it loses is
PublicApiFilter.isSyntheticSymdropping symbols, a filter bug a per-signature caveat does nothing about. The TASTy side also failed to load 5 of 81 symbols (None,Predef,AnyVal,Tuple2,SeqOps); the pickle side failed none.What is actually missing
Documentation. Pickles carry no Scaladoc: 0 of 76 Scala 2 lookups had prose docs versus 70 of 76 from TASTy. Verified directly —
cats.effect.IOprints its docstring,cats.data.NonEmptyListprints none.The change
GetHandler.warnScala2) toNote: Scala 2 artifact — documentation comments are not available.— true for 76/76, unlike the type claim.No per-signature predicate replaces it. If one is ever wanted, the defensible condition is language-independent — "the printer hit its fallback" — not "the source was Scala 2".
Verification
lib.test372/372. The twoIntegrationTestassertions on the stderr note still hold (the footer still mentions Scala 2, with accurate wording). TheTypePrinterTestcase that asserted the old caveat is updated to assert its absence plus the real signature.Follow-ups this surfaced (not in this PR)
Verified against published artifacts, one PR each:
NonEmptyCollection[A, List, [A] =>> NonEmptyList[A]]where Scala 2 printsNonEmptyList; inconsistent within a single line.scala.jdk.CollectionConvertersshows 20class *HasAs*wrappers but 0 of thedefs that attach them.scala.Charrendersval MaxValue:with a raw U+FFFF andval MinValue:with a raw NUL into Markdown.🤖 Generated with Claude Code