feat(lift-util)!: add support for Scala 3 cross build#2039
Conversation
- Fix indentation to comply with Scala 3's stricter rules - Add explicit type bounds where Scala 3 type inference requires them - Fix implicit conversions for Scala 3 compatibility - Remove SourceInfo.scala (relied on Scala 2 reflection) - Remove deprecated implicit conversions in TimeHelpers BREAKING CHANGE: Removes SourceInfo trait and related functionality that relied on Scala 2 reflection APIs not available in Scala 3.
- Fix StringHelpers tuple addition in foldLeft - Add public hasMoreInput method to PCDataXmlParser to work around Scala 3 protected access restrictions - Add case keyword to refutable pattern match in Props.scala 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Scala 3 cross-compilation to the lift-util project. The changes primarily involve updating dependency handling for Scala 3 compatibility and fixing various code compatibility issues that arose when upgrading to support both Scala 2 and Scala 3.
- Updates the
scala_compilerdependency to conditionally use different artifacts based on Scala version - Removes deprecated implicit conversions and methods that are incompatible with Scala 3
- Fixes various syntax and compilation issues for Scala 3 compatibility
Reviewed Changes
Copilot reviewed 16 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| project/Dependencies.scala | Updates scala_compiler dependency to support both Scala 2 and 3 versions |
| core/util/src/test/scala/net/liftweb/util/VCardParserSpec.scala | Reorganizes test structure for better compilation |
| core/util/src/test/scala/net/liftweb/util/TimeHelpersSpec.scala | Removes test cases that depend on deprecated functionality |
| core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala | Adds explicit type annotations for implicit values |
| core/util/src/main/scala/net/liftweb/util/TimeHelpers.scala | Removes deprecated implicit conversions incompatible with Scala 3 |
| core/util/src/main/scala/net/liftweb/util/StringHelpers.scala | Simplifies foldLeft syntax for better Scala 3 compatibility |
| core/util/src/main/scala/net/liftweb/util/SourceInfo.scala | Removes entire file (possibly incompatible with Scala 3) |
| core/util/src/main/scala/net/liftweb/util/Schedule.scala | Fixes brace placement for proper syntax |
| core/util/src/main/scala/net/liftweb/util/Props.scala | Adds case keyword for pattern matching in for-comprehension |
| core/util/src/main/scala/net/liftweb/util/PCDataMarkupParser.scala | Adds public accessor to work around Scala 3 protected access restrictions |
| core/util/src/main/scala/net/liftweb/util/ListHelpers.scala | Fixes variable naming conflicts with backticks |
| core/util/src/main/scala/net/liftweb/util/IterableFunc.scala | Updates type constraint for better type inference |
| core/util/src/main/scala/net/liftweb/util/HtmlParser.scala | Adds Scala 3 compatibility fix for empty list handling |
| core/util/src/main/scala/net/liftweb/util/FatLazy.scala | Fixes None comparison using toOption |
| core/util/src/main/scala/net/liftweb/util/CssSel.scala | Removes unnecessary null check in flatMap |
| core/util/src/main/scala/net/liftweb/util/CombParserHelpers.scala | Fixes implicit conversion usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if ((pool eq null) || pool.isShutdown) | ||
| pool = buildExecutor() | ||
| } | ||
| def restart: Unit = synchronized { if ((service eq null) || service.isShutdown) |
There was a problem hiding this comment.
There's a duplicated condition check. The second if statement on line 84 appears to be a copy-paste error from line 83, creating unreachable or redundant logic.
| def restart: Unit = synchronized { if ((service eq null) || service.isShutdown) | |
| def restart: Unit = synchronized { |
| */ | ||
| def acceptCI[ES](es: ES)(implicit ev: ES => List[Elem]): Parser[List[Elem]] = | ||
| es.foldRight[Parser[List[Elem]]]( | ||
| ev(es).foldRight[Parser[List[Elem]]]( |
There was a problem hiding this comment.
The explicit call to ev(es) is unnecessary since the implicit conversion should be applied automatically. This suggests a potential issue with the implicit conversion or type inference.
| ev(es).foldRight[Parser[List[Elem]]]( | |
| es.foldRight[Parser[List[Elem]]]( |
feat(lift-util)!: add support for Scala 3 cross build (lift#2039) * fix(lift-util): bring in correct scala3 compiler dependency * feat(lift-util)!: scala 3.3.6 compatibility fixes - Fix indentation to comply with Scala 3's stricter rules - Add explicit type bounds where Scala 3 type inference requires them - Fix implicit conversions for Scala 3 compatibility - Remove SourceInfo.scala (relied on Scala 2 reflection) - Remove deprecated implicit conversions in TimeHelpers BREAKING CHANGE: Removes SourceInfo trait and related functionality that relied on Scala 2 reflection APIs not available in Scala 3. * fix(lift-util): resolve scala 3.3.6 compilation errors - Fix StringHelpers tuple addition in foldLeft - Add public hasMoreInput method to PCDataXmlParser to work around Scala 3 protected access restrictions - Add case keyword to refutable pattern match in Props.scala 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat(lift-util): work on getting tests cross-building * fix(lift-util): get tests passing for scala 3 again --------- Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit 218391d)
Working on getting a functional build of lift-util for Scala 3.3.6.