From 9a48e7bc56979c5968149e6aabdae96d33681a60 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 4 Sep 2016 18:41:22 +0200 Subject: Don't inline after typer. Safety measure: Inline only during typer, not when code is generated in later phases. --- src/dotty/tools/dotc/typer/Typer.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 09259b361..3672996c8 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1793,7 +1793,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit tree } else if (tree.tpe <:< pt) - if (tree.symbol.isInlineMethod && !ctx.owner.ownersIterator.exists(_.isInlineMethod)) + if (tree.symbol.isInlineMethod && + !ctx.owner.ownersIterator.exists(_.isInlineMethod) && + !ctx.isAfterTyper) adapt(Inliner.inlineCall(tree, pt), pt) else if (ctx.typeComparer.GADTused && pt.isValueType) // Insert an explicit cast, so that -Ycheck in later phases succeeds. -- cgit v1.2.3