Skip to content

Missing given flag in given case bindings in TASTy #11594

@nicolasstucki

Description

@nicolasstucki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tasty-formatissues relating to TASTy as a portable standard

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions