Skip to content

Commit abcee5b

Browse files
committed
Fix ctx of opaque type companion
1 parent 3ec61ce commit abcee5b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,8 @@ object Trees {
12441244
Stats.record("TreeAccumulator.foldOver total")
12451245
def localCtx =
12461246
if (tree.hasType && tree.symbol.exists) ctx.withOwner(tree.symbol) else ctx
1247+
def templateCtx =
1248+
ctx.handleOpaqueCompanion(ctx.fresh, ctx.owner)
12471249
tree match {
12481250
case Ident(name) =>
12491251
x
@@ -1320,6 +1322,7 @@ object Trees {
13201322
implicit val ctx = localCtx
13211323
this(x, rhs)
13221324
case tree @ Template(constr, parents, self, _) =>
1325+
implicit val ctx = templateCtx
13231326
this(this(this(this(x, constr), parents), self), tree.body)
13241327
case Import(expr, selectors) =>
13251328
this(x, expr)

compiler/test/dotty/tools/dotc/FromTastyTests.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class FromTastyTests extends ParallelTesting {
2929
val (step1, step2, step3) = compileTastyInDir("tests/pos", defaultOptions,
3030
blacklist = Set(
3131

32-
"opaque.scala",
33-
"opaque-propability.scala",
3432
"opaque-immutable-array.scala",
3533

3634
"macro-deprecate-dont-touch-backquotedidents.scala",

0 commit comments

Comments
 (0)