File tree 2 files changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/inlines
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,9 @@ class Inliner(val call: tpd.Tree)(using Context):
384
384
*/
385
385
private val opaqueProxies = new mutable.ListBuffer [(TermRef , TermRef )]
386
386
387
+ /** TermRefs for which we already started synthesising proxies */
388
+ private val visitedTermRefs = new mutable.HashSet [TermRef ]
389
+
387
390
protected def hasOpaqueProxies = opaqueProxies.nonEmpty
388
391
389
392
/** Map first halves of opaqueProxies pairs to second halves, using =:= as equality */
@@ -401,8 +404,9 @@ class Inliner(val call: tpd.Tree)(using Context):
401
404
for cls <- ref.widen.baseClasses do
402
405
if cls.containsOpaques
403
406
&& (forThisProxy || inlinedMethod.isContainedIn(cls))
404
- && mapRef (ref).isEmpty
407
+ && ! visitedTermRefs.contains (ref)
405
408
then
409
+ visitedTermRefs += ref
406
410
val refiningRef = OpaqueProxy (ref, cls, call.span)
407
411
val refiningSym = refiningRef.symbol.asTerm
408
412
val refinedType = refiningRef.info
Original file line number Diff line number Diff line change
1
+ import Result .*
2
+ opaque type Result [+ E , + A ] = Success [A ] | Error [E ]
3
+
4
+ object Result :
5
+ opaque type Success [+ A ] = A
6
+ sealed abstract class Error [+ E ]
7
+
8
+ extension [E , A ](self : Result [E , A ])
9
+ inline def transform [B ]: B = ???
10
+ def problem : Boolean = transform[Boolean ]
You can’t perform that action at this time.
0 commit comments