Skip to content

Commit 0d96406

Browse files
committed
Don't do post checks in inlined code
Capability references in inlined code might end up not being tracked or being redundant. Don't flag this as an error.
1 parent 18778a4 commit 0d96406

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/cc/Setup.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
753753

754754
/** Check well formed at post check time */
755755
private def checkWellformedLater(parent: Type, ann: Tree, tpt: Tree)(using Context): Unit =
756-
if !tpt.span.isZeroExtent then
756+
if !tpt.span.isZeroExtent && enclosingInlineds.isEmpty then
757757
todoAtPostCheck += (ctx1 =>
758758
checkWellformedPost(parent, ann, tpt)(using ctx1.withOwner(ctx.owner)))
759759

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trait Listener[+T]
2+
3+
inline def consume[T](f: T => Unit): Listener[T]^{f} = ???
4+
5+
val consumePure = consume(_ => ())

0 commit comments

Comments
 (0)