Skip to content

Fix #8050: Make isInlineable force less #8070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object Inliner {

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

/** Should call be inlined in this context? */
def isInlineable(tree: Tree)(implicit ctx: Context): Boolean = tree match {
Expand Down
5 changes: 5 additions & 0 deletions tests/neg/i8050.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
object stuff with
def exec(dir: Int) = ???

extension on (a: Int) with
inline def exec: Unit = stuff.exec("aaa") // error