Skip to content

Missing given flag in given case bindings in TASTy #11594

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

Closed
nicolasstucki opened this issue Mar 4, 2021 · 1 comment · Fixed by #11595
Closed

Missing given flag in given case bindings in TASTy #11594

nicolasstucki opened this issue Mar 4, 2021 · 1 comment · Fixed by #11595
Labels
area:tasty-format issues relating to TASTy as a portable standard
Milestone

Comments

@nicolasstucki
Copy link
Contributor

Compiler version

3.0.0-RC1

Minimized example

class Foo:
  def test: Unit =
    ??? match
      case i @ given Int =>

Output

sbt:scala3> scalac -Ythrough-tasty Foo.scala -Xprint:inlining
result of Foo.scala after inlining:
package <empty> {
  @scala.annotation.internal.SourceFile("Foo.scala") class Foo() extends Object(
    )
   {
    def test: Unit = 
      ??? match 
        {
          case given i @ _:Int => 
            ()
        }
  }
}
Compiling from .tasty sources
result of /Users/nicolasstucki/GitHub/dotty/out/from-tasty-tmp2033092918167241665/from-source/Foo.class after inlining:
package <empty> {
  @scala.annotation.internal.SourceFile("Foo.scala") class Foo() extends Object(
    )
   {
    def test: Unit = 
      ??? match 
        {
          case i @ _:Int => 
            ()
        }
  }
}
    44:           CASEDEF(22)
    46:             BIND(17) 15 [i]
    49:               TYPEREF 16 [Nothing]
    51:                 SHAREDtype 24
    53:               TYPED(10)
    55:                 IDENT 17 [_]
    57:                   TYPEREF 18 [Int]
    59:                     SHAREDtype 34
    61:                 IDENTtpt 18 [Int]
    63:                   SHAREDtype 57

Expectation

Given flag should be included in tasty.

@nicolasstucki nicolasstucki added this to the 3.0.0-RC2 milestone Mar 4, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 4, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 4, 2021
@nicolasstucki
Copy link
Contributor Author

Discovered in #11593

@nicolasstucki nicolasstucki changed the title Missing given flag in given case bindings Missing given flag in given case bindings in TASTy Mar 4, 2021
@nicolasstucki nicolasstucki added the area:tasty-format issues relating to TASTy as a portable standard label Mar 4, 2021
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant