File tree 3 files changed +23
-0
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1280,6 +1280,24 @@ class Namer { typer: Typer =>
1280
1280
}
1281
1281
}
1282
1282
1283
+ def completeChildren () =
1284
+
1285
+ def completeChildrenIn (owner : Symbol ) =
1286
+ def maybeChild (c : Symbol ) =
1287
+ ! owner.is(Package )
1288
+ || c.infoOrCompleter.isInstanceOf [ClassCompleter ]
1289
+ && c.associatedFile == cls.associatedFile
1290
+ for c <- owner.info.decls.toList if c.isClass && maybeChild(c) do
1291
+ // println(i"possible child of $cls: $c")
1292
+ c.ensureCompleted()
1293
+
1294
+ if cls.is(Sealed ) then
1295
+ // println(i"completing children of $cls in ${cls.owner}")
1296
+ completeChildrenIn(cls.owner)
1297
+ completeChildrenIn(cls.companionClass)
1298
+ // println(i"completed children of $cls")
1299
+ end completeChildren
1300
+
1283
1301
completeConstructor(denot)
1284
1302
denot.info = tempInfo
1285
1303
@@ -1307,6 +1325,7 @@ class Namer { typer: Typer =>
1307
1325
cls.setNoInitsFlags(parentsKind(parents), untpd.bodyKind(rest))
1308
1326
if (cls.isNoInitsClass) cls.primaryConstructor.setFlag(StableRealizable )
1309
1327
processExports(localCtx)
1328
+ completeChildren()
1310
1329
}
1311
1330
}
1312
1331
Original file line number Diff line number Diff line change
1
+ def Test =
2
+ summon[deriving.Mirror .SumOf [Foo ]]
Original file line number Diff line number Diff line change
1
+ sealed trait Foo
2
+ case class Bar (x : Int ) extends Foo
You can’t perform that action at this time.
0 commit comments