Skip to content

Back absence evidence with an object so newer Scala 3 compilers link - #154

Merged
jleider merged 1 commit into
mainfrom
fix-field-absent-erasure
Nov 24, 2026
Merged

jleider merged 1 commit into
mainfrom
fix-field-absent-erasure

Conversation

@jleider

@jleider jleider commented Nov 24, 2026

Copy link
Copy Markdown
Member

FieldAbsent and MaybeRecord were opaque types over Unit. Scala 3.3 erases a method returning such a type to BoxedUnit and Scala 3.10 to void, so code compiled with 3.10 against the published 3.3 jar fails at runtime with NoSuchMethodError: 'void formless.record.Lookup$package$FieldAbsent$.inline$proof()' wherever FieldAbsent is proven: LacksKey, NotContains, MergeWith and Union. Scala 3.8 erases it like 3.3, so coreNext3 didn't catch it.

Change
Lookup.scala FieldAbsent and MaybeRecord are backed by a private[formless] object Proven, which erases the same way under every Scala 3 compiler
linkage New project: runs core's JVM test suite compiled with the newest Scala 3 against the Scala 3 LTS build of core's main classes, the way a user's build links against the published jar. Without the fix it fails with the NoSuchMethodError above
coreLatest3 New matrix row testing core on Scala 3.10, tested but not published, like coreNext3; the test source generators are shared with linkage
Version 0.9.1

The absence givens now take Proven instead of BoxedUnit, so code compiled against 0.9.0 that summons LacksKey/NotContains must be recompiled.

https://claude.ai/code/session_0183D2EgXE7mpWaqAh2rBSKy

@jleider
jleider marked this pull request as ready for review November 24, 2026 19:59
FieldAbsent and MaybeRecord were opaque types over Unit. Scala 3.3 erases
a method returning such a type to BoxedUnit and Scala 3.10 to void, so
code compiled with 3.10 against the published 3.3 jar failed with
NoSuchMethodError on FieldAbsent's inlined proof accessor (reached through
LacksKey, NotContains, MergeWith and Union). Both are now backed by an
object, which erases the same way under every Scala 3 compiler.

- linkage: runs core's JVM test suite compiled with the newest Scala 3
  against the published Scala 3 LTS build of core's main classes
- coreLatest3: tests core with Scala 3.10, tested but not published
- Version 0.9.1

Claude-Session: https://claude.ai/code/session_0183D2EgXE7mpWaqAh2rBSKy
@jleider
jleider force-pushed the fix-field-absent-erasure branch from 4cb3660 to 95d025c Compare November 24, 2026 20:21
@jleider
jleider merged commit 4687f23 into main Nov 24, 2026
5 checks passed
@jleider
jleider deleted the fix-field-absent-erasure branch November 24, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant