Skip to content

Incorrectly constructed trees when inlining with bound type parameters #7293

Closed
@anatoliykmetyuk

Description

@anatoliykmetyuk

minimized code

trait Foo { def f(x: Int): Any }

inline def f[T <: Foo]: T = (??? match {
  case t: T => t.f(10)
}).asInstanceOf[T]

@main def Test = f

Says:

-- Error: ../pg/i3.scala:4:18 --------------------------------------------------
4 |  case t: T => t.f(10)
  |               ^^^^^^^
  |     undefined: t.f # 1201: TermRef(TermRef(NoPrefix,val t),f) at frontend
one error found

expectation

It should compile.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions