Skip to content

Compiler ignores @tailrec if inline is present #10970

@ansvonwa

Description

@ansvonwa

Minimized code

scala> import scala.annotation.tailrec
scala> @tailrec inline def foo() = ???

Output

def foo(): Nothing

Expectation

An error, as in

scala> @tailrec def bar() = ???                                                                                              
1 |@tailrec def bar() = ???
  |             ^
  |TailRec optimisation not applicable, method bar contains no recursive calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions