Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context bounds types are not simplified in TASTy #20901

Closed
bishabosha opened this issue Jul 1, 2024 · 0 comments · Fixed by #20910
Closed

Context bounds types are not simplified in TASTy #20901

bishabosha opened this issue Jul 1, 2024 · 0 comments · Fixed by #20910
Assignees
Labels
area:tasty-format issues relating to TASTy as a portable standard itype:bug regression This worked in a previous version but doesn't anymore

Comments

@bishabosha
Copy link
Member

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)
  }
}
@bishabosha bishabosha added itype:bug area:tasty-format issues relating to TASTy as a portable standard regression This worked in a previous version but doesn't anymore labels Jul 1, 2024
@sjrd sjrd closed this as completed in d68b645 Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tasty-format issues relating to TASTy as a portable standard itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant