File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/inlines
tests/pos-custom-args/captures Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -596,7 +596,7 @@ class Inliner(val call: tpd.Tree)(using Context):
596
596
val inlinedSingleton = singleton(t).withSpan(argSpan)
597
597
inlinedFromOutside(inlinedSingleton)(tree.span)
598
598
case Some (t) if tree.isType =>
599
- inlinedFromOutside(TypeTree (t).withSpan(argSpan))(tree.span)
599
+ inlinedFromOutside(new InferredTypeTree ().withType (t).withSpan(argSpan))(tree.span)
600
600
case _ => tree
601
601
}
602
602
case tree @ Select (qual : This , name) if tree.symbol.is(Private ) && tree.symbol.isInlineMethod =>
Original file line number Diff line number Diff line change
1
+ class ContextClass
2
+ type Context = ContextClass ^
3
+ class ParamRef :
4
+ def isTracked (using Context ): Boolean = ???
5
+ trait Lam [PR <: ParamRef ]:
6
+ val paramRefs : List [PR ] = ???
7
+ inline def atPhase [T ]()(inline op : Context ?=> T )(using ctx : Context ): T =
8
+ op(using ctx)
9
+
10
+ def Test (using ctx : Context ) =
11
+ val info : Lam [ParamRef ] = ???
12
+ info.paramRefs.filter(_.isTracked)
13
+ val p = atPhase()((_ : ParamRef ).isTracked)
14
+ val _: ParamRef -> {ctx} Boolean = p
15
+
16
+ // val f: String => ParamRef = ???
17
+ // val q = f.andThen(p)
18
+
You can’t perform that action at this time.
0 commit comments