Skip to content

Commit 3214981

Browse files
committed
Fix #6373: Consider synthetic inlined methods as inline methods
1 parent 311b851 commit 3214981

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ object SymDenotations {
803803
def isSkolem: Boolean = name == nme.SKOLEM
804804

805805
def isInlineMethod(implicit ctx: Context): Boolean =
806-
is(InlineMethod, butNot = AccessorOrSynthetic) &&
806+
is(InlineMethod, butNot = Accessor) &&
807807
name != nme.unapply // unapply methods do not count as inline methods
808808
// we need an inline flag on them only do that
809809
// reduceProjection gets access to their rhs

tests/pos/i6373.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
object Test {
2+
class Test {
3+
class Context(val t: Boolean)
4+
5+
type Contextual[T] = given Context => T
6+
7+
inline def f(): Contextual[Boolean] = the[Context].t
8+
9+
implied ctx for Context = new Context(true)
10+
11+
f()
12+
}
13+
}

0 commit comments

Comments
 (0)