Skip to content

Commit 3bee284

Browse files
committed
Fix FromSymbol.classDef
1 parent d827f65 commit 3bee284

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
251251
val constr = firstParent.decl(nme.CONSTRUCTOR).suchThat(constr => isApplicable(constr.info))
252252
New(firstParent, constr.symbol.asTerm, superArgs)
253253
}
254-
val parents = superRef :: otherParents.map(TypeTree(_))
254+
ClassDefWithParents(cls, constr, superRef :: otherParents.map(TypeTree(_)), body)
255+
}
255256

257+
def ClassDefWithParents(cls: ClassSymbol, constr: DefDef, parents: List[Tree], body: List[Tree])(implicit ctx: Context): TypeDef = {
256258
val selfType =
257259
if (cls.classInfo.selfInfo ne NoType) ValDef(ctx.newSelfSym(cls))
258260
else EmptyValDef

compiler/src/dotty/tools/dotc/tastyreflect/FromSymbol.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ object FromSymbol {
2323
val constrSym = cls.unforcedDecls.find(_.isPrimaryConstructor)
2424
if (!constrSym.exists) return tpd.EmptyTree
2525
val constr = tpd.DefDef(constrSym.asTerm)
26+
val parents = cls.classParents.map(tpd.TypeTree(_))
2627
val body = cls.unforcedDecls.filter(!_.isPrimaryConstructor).map(s => definition(s))
27-
val superArgs = Nil // TODO
28-
tpd.ClassDef(cls, constr, body, superArgs)
28+
tpd.ClassDefWithParents(cls, constr, parents, body)
2929
}
3030

3131
def typeDef(sym: TypeSymbol)(implicit ctx: Context): tpd.TypeDef = tpd.TypeDef(sym)
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# Closure type miss match
22
eff-dependent.scala
3-
4-
# superArgs missing (see TODO in tastyreflect/FromSymbol.scala)
5-
reduce-projection.scala

0 commit comments

Comments
 (0)