@@ -43,6 +43,7 @@ class MetaContextPlacerPhase(setting: Setting) extends CommonPhase:
43
43
var dfSpecTpe : Type = uninitialized
44
44
var hasClsMetaArgsTpe : TypeRef = uninitialized
45
45
var clsMetaArgsTpe : TypeRef = uninitialized
46
+ var designTpe : TypeRef = uninitialized
46
47
var topAnnotSym : ClassSymbol = uninitialized
47
48
var appTpe : TypeRef = uninitialized
48
49
var noTopAnnotIsRequired : TypeRef = uninitialized
@@ -143,12 +144,12 @@ class MetaContextPlacerPhase(setting: Setting) extends CommonPhase:
143
144
}
144
145
val nonParamBody = template.body.drop(paramBody.length)
145
146
val (updatedBody, designParamGenValDefs) = dfcArgOpt match
146
- case Some (dfcTree) =>
147
+ case Some (dfcTree) if clsTpe <:< designTpe =>
147
148
val defaults = defaultParamMap.getOrElse(clsSym, Map .empty)
148
149
genDesignBodyParams(nonParamBody, paramBody, defaults, dfcTree)(using
149
150
ctx.withOwner(clsSym.primaryConstructor)
150
151
)
151
- case None => (nonParamBody, Nil )
152
+ case _ => (nonParamBody, Nil )
152
153
// TODO: The override does not seem to be actually used by the runtime,
153
154
// probably because it's selected during the typer stage and needs to be
154
155
// changed somehow to reference the new overridden tree symbol.
@@ -298,6 +299,7 @@ class MetaContextPlacerPhase(setting: Setting) extends CommonPhase:
298
299
dfSpecTpe = requiredClassRef(" dfhdl.DFSpec" )
299
300
hasClsMetaArgsTpe = requiredClassRef(" dfhdl.internals.HasClsMetaArgs" )
300
301
clsMetaArgsTpe = requiredClassRef(" dfhdl.internals.ClsMetaArgs" )
302
+ designTpe = requiredClassRef(" dfhdl.core.Design" )
301
303
topAnnotSym = requiredClass(" dfhdl.top" )
302
304
appTpe = requiredClassRef(" dfhdl.app.DFApp" )
303
305
noTopAnnotIsRequired = requiredClassRef(" dfhdl.internals.NoTopAnnotIsRequired" )
0 commit comments