Dotty: Compiler ignores @tailrec if inline is present

Created on 2 Jan 2021  路  1Comment  路  Source: lampepfl/dotty

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
bug

Most helpful comment

Or: forbid combination of tailRec and inline.

>All comments

Or: forbid combination of tailRec and inline.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deusaquilus picture deusaquilus  路  3Comments

liufengyun picture liufengyun  路  3Comments

NightMachinary picture NightMachinary  路  3Comments

dwijnand picture dwijnand  路  3Comments

julienrf picture julienrf  路  3Comments