Skip to content

Fix #6373: Consider synthetic inlined methods as inline methods #6374

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
Apr 25, 2019
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/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions tests/pos/i6373.scala
Original file line number Diff line number Diff line change
@@ -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()
}
}