Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scala/scala3
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main@{1day}
Choose a base ref
...
head repository: scala/scala3
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 11 commits
  • 8 files changed
  • 1 contributor

Commits on Jun 26, 2025

  1. Copy the full SHA
    6e466de View commit details
  2. Copy the full SHA
    0463b76 View commit details
  3. Try to optimize typed vars

    noti0na1 committed Jun 26, 2025
    Copy the full SHA
    6841cd1 View commit details
  4. Remove typed vars logic

    noti0na1 committed Jun 26, 2025
    Copy the full SHA
    74e2b76 View commit details
  5. Copy the full SHA
    310e20b View commit details
  6. Copy the full SHA
    5f79048 View commit details
  7. Copy the full SHA
    568b115 View commit details
  8. Copy the full SHA
    545dd69 View commit details
  9. Remove debug comment

    noti0na1 committed Jun 26, 2025
    Copy the full SHA
    d614d0b View commit details

Commits on Jul 9, 2025

  1. Copy the full SHA
    82c068c View commit details

Commits on Jul 11, 2025

  1. Fix #23224: Optimize simple tuple extraction (#23373)

    Close #23224:
    
    This PR optimizes simple tuple extraction by avoiding unnecessary tuple
    allocations and refines the typing of bind patterns for named tuples.
    
    * Optimise `makePatDef` to reduce tuple creation when a pattern uses
    only simple variables or wildcards.
    * If the selector of a match has bottom type, use the type from pattern
    for the bind variable.
    
    For example:
    
    ```scala
    def f1: (Int, Int, Int) = (1, 2, 3)
    def test1 =
      val (a, b, c) = f1
      a + b + c
    ```
    
    Before this PR:
    
    ```scala
    val $1$: (Int, Int, Int) =
      this.f1:(Int, Int, Int) @unchecked match 
        {
          case Tuple3.unapply[Int, Int, Int](a @ _, b @ _, c @ _) =>
            Tuple3.apply[Int, Int, Int](a, b, c)
        }
    val a: Int = $1$._1
    val b: Int = $1$._2
    val c: Int = $1$._3
    a + b + c
    ```
    
    After this PR:
    
    ```scala
    val $2$: (Int, Int, Int) =
      this.f1:(Int, Int, Int) @unchecked match 
        {
          case $1$ @ Tuple3.unapply[Int, Int, Int](_, _, _) =>
            $1$:(Int, Int, Int)
        }
    val a: Int = $2$._1
    val b: Int = $2$._2
    val c: Int = $2$._3
    a + b + c
    ```
    
    Also in genBCode now:
    
    ```scala
    val $2$: Tuple3 =  
      matchResult1[Tuple3]:
        {
          case val x1: Tuple3 = this.f1():Tuple3
          if x1 ne null then
            {
              case val $1$: Tuple3 = x1
              return[matchResult1] $1$:Tuple3
            }
            else ()
          throw new MatchError(x1)
        }
    val a: Int = Int.unbox($2$._1())
    val b: Int = Int.unbox($2$._2())
    val c: Int = Int.unbox($2$._3())
    a + b + c
    ```
    
    I use the regular expression
    (`val\s*\(\s*[a-zA-Z_]\w*(\s*,\s*[a-zA-Z_]\w*)*\s*\)\s*=`) to search in
    the compiler, and found 400+ places which are simple tuple extraction
    like this.
    noti0na1 authored Jul 11, 2025
    Copy the full SHA
    6f35f4a View commit details

This comparison is taking too long to generate.

Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.

You can try running this command locally to see the comparison on your machine:
git diff main@{1day}...main