I am building a DSL in Scala, and for that, I need to store \"instances\" of a class (Parent in this case), except these \"instances\" must be re-created several ti
Parent
If I understood correctly, you just need to change object to def in the ObjectA block:
object
def
ObjectA
class User { var userVar = 13 def makeParent = new Parent { func(1) func(userVar) } construct(makeParent) }
and it'll do what you want.