Skip to content

Call to abstract inline method not failing compilation when inlined #12555

Closed
@kubukoz

Description

@kubukoz

Compiler version

3.0.0

Minimized code

trait Noop[T]:
  //note: making this "not inline" fixes the result
  inline def noop(fa: T): T

object Noop {
  inline def noop[T](alg: T)(using n: Noop[T]): T = n.noop(alg)
}

import Noop.*

final case class User(name: String, age: Int)

inline given Noop[User] = a => a

val u = User("hello", 45)

@main
def run = println(Noop.noop(u))

Output

null

Expectation

User("hello", 45)

Here's a scastie:

https://scastie.scala-lang.org/i1aeCpLuTNatjchMPW9dfQ

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions