Skip to content

Context bounds types are not simplified in TASTy #20901

Closed
@bishabosha

Description

@bishabosha

Compiler version

3.5.0-RC1

Context bounds are not simplified before TASTy any more (possibly due to modularity PR?),

e.g.

def test[T: ClassTag] = ???

will appear in TASTy as

def test[T](implicit evidence$1: ([T1] =>> ClassTag[T1])[T]) = ???

Minimized code

package foo

import scala.reflect.ClassTag

class Foo {
  def test[T: ClassTag] = new Array[T](0)
}

Output

> scalac -decompile out/foo/Foo.tasty
/** Decompiled from out/foo/Foo.tasty */
package foo {
  import scala.reflect.{ClassTag}
  @scala.annotation.internal.SourceFile("Foo.scala") class Foo() {
    def test[T](implicit evidence$1: [T >: scala.Nothing <: scala.Any] =>> scala.reflect.ClassTag[T][T]): scala.Array[T] = scala.runtime.Arrays.newGenericArray[T](0)(evidence$1)
  }
}

Expectation

As with 3.4.2:

/** Decompiled from out-3.4/foo/Foo.tasty */
package foo {
  import scala.reflect.{ClassTag}
  @scala.annotation.internal.SourceFile("Foo.scala") class Foo() {
    def test[T](implicit evidence$1: scala.reflect.ClassTag[T]): scala.Array[T] = scala.runtime.Arrays.newGenericArray[T](0)(evidence$1)
  }
}

Metadata

Metadata

Assignees

Labels

area:tasty-formatissues relating to TASTy as a portable standarditype:bugregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions