Skip to content

feat(lift-util)!: add support for Scala 3 cross build#2039

Merged
farmdawgnation merged 5 commits into
lift-4.0from
msf/lift-util-scala3
Oct 2, 2025
Merged

feat(lift-util)!: add support for Scala 3 cross build#2039
farmdawgnation merged 5 commits into
lift-4.0from
msf/lift-util-scala3

Conversation

@farmdawgnation

@farmdawgnation farmdawgnation commented Oct 1, 2025

Copy link
Copy Markdown
Member

Working on getting a functional build of lift-util for Scala 3.3.6.

farmdawgnation and others added 4 commits September 30, 2025 21:43
- 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>
@farmdawgnation
farmdawgnation changed the base branch from main to lift-4.0 October 1, 2025 02:27
@farmdawgnation farmdawgnation changed the title feat(lift-util)!: iterating on working scala 3 build feat(lift-util)!: add support for Scala 3 cross build Oct 2, 2025
@farmdawgnation
farmdawgnation requested a review from Copilot October 2, 2025 03:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_compiler dependency 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)

Copilot AI Oct 2, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
def restart: Unit = synchronized { if ((service eq null) || service.isShutdown)
def restart: Unit = synchronized {

Copilot uses AI. Check for mistakes.
*/
def acceptCI[ES](es: ES)(implicit ev: ES => List[Elem]): Parser[List[Elem]] =
es.foldRight[Parser[List[Elem]]](
ev(es).foldRight[Parser[List[Elem]]](

Copilot AI Oct 2, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
ev(es).foldRight[Parser[List[Elem]]](
es.foldRight[Parser[List[Elem]]](

Copilot uses AI. Check for mistakes.
@farmdawgnation
farmdawgnation merged commit 218391d into lift-4.0 Oct 2, 2025
3 checks passed
@farmdawgnation
farmdawgnation deleted the msf/lift-util-scala3 branch October 2, 2025 03:30
joe-op added a commit to joe-op/lift-framework that referenced this pull request Jan 22, 2026
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)
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.

2 participants