Skip to content

Commit 183bcd3

Browse files
committed
Fix #8050: Make isInlineable force less
The isInleable test forced the inline body. This causes problem if the inline body is currently typechecked.
1 parent 5d354f3 commit 183bcd3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object Inliner {
5050

5151
/** Should call to method `meth` be inlined in this context? */
5252
def isInlineable(meth: Symbol)(implicit ctx: Context): Boolean =
53-
meth.is(Inline) && !ctx.inInlineMethod && !bodyToInline(meth).isEmpty
53+
meth.is(Inline) && meth.hasAnnotation(defn.BodyAnnot) && !ctx.inInlineMethod
5454

5555
/** Should call be inlined in this context? */
5656
def isInlineable(tree: Tree)(implicit ctx: Context): Boolean = tree match {

tests/neg/i8050.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object stuff with
2+
def exec(dir: Int) = ???
3+
4+
extension on (a: Int) with
5+
inline def exec: Unit = stuff.exec("aaa") // error

0 commit comments

Comments
 (0)