Skip to content

Incorrect type error after inlining #24479

@eejbyfeldt

Description

@eejbyfeldt

Compiler version

3.7.4, 3.8.1-RC1-bin-20251119-df117fc-NIGHTLY

Minimized code

object test {
  class A
  class B extends A

  inline def f[T](inline v: Any): T = inline v match {
    case x: T => x
  }

  inline def b: B = new B() 
  f[A](b: A)
}

Output

[error] ./inline_bug.scala:10:8
[error] Found:    test.A
[error] Required: test.B
[error]   f[A](b: A)
[error]        ^^^^

Expectation

Compiles without failure.

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