From 32149812edeede608db3b91e6e972bb13b0839d0 Mon Sep 17 00:00:00 2001 From: Aggelos Biboudis Date: Thu, 25 Apr 2019 15:42:39 +0200 Subject: [PATCH] Fix #6373: Consider synthetic inlined methods as inline methods --- .../src/dotty/tools/dotc/core/SymDenotations.scala | 2 +- tests/pos/i6373.scala | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/pos/i6373.scala diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 6aaca2d587cc..9b4223e05f15 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -803,7 +803,7 @@ object SymDenotations { def isSkolem: Boolean = name == nme.SKOLEM def isInlineMethod(implicit ctx: Context): Boolean = - is(InlineMethod, butNot = AccessorOrSynthetic) && + is(InlineMethod, butNot = Accessor) && name != nme.unapply // unapply methods do not count as inline methods // we need an inline flag on them only do that // reduceProjection gets access to their rhs diff --git a/tests/pos/i6373.scala b/tests/pos/i6373.scala new file mode 100644 index 000000000000..68a2abb59068 --- /dev/null +++ b/tests/pos/i6373.scala @@ -0,0 +1,13 @@ +object Test { + class Test { + class Context(val t: Boolean) + + type Contextual[T] = given Context => T + + inline def f(): Contextual[Boolean] = the[Context].t + + implied ctx for Context = new Context(true) + + f() + } +} \ No newline at end of file