I have a base object that defines a field which can be a parsecfg.Config or JsonNode
type ParseType* = Config | JsonNode
type base*[T: ParseType] = ref object of RootObj
  parsed*: T # <-- can be a Config or JsonNode
I also want to define the base interface, which should be implemented by subtypes
method xyz*(self: base): bool {.base.} = raise tddError
method xyz*(self: base[ParseType]): bool {.base.} = raise tddError
is there a way to get around having to use (self: base[Config | JsonNode])...
i imagine the list of ParseTypes will grow, and am looking for a way to get around the deprecation error
i ended up just moving the type alias into the object
type ParseType* = Config | JsonNode
type base* = ref object of RootObj
  parsed*: ParseType
i ended up just moving the type alias into the object
That doesn't work either. ;-)
To answer your question: Your design is convoluted, here is what to do instead:
type
  ConfigData = object
    username, pw: string
    frequency: float
    machineCount: int
proc fromConfig(filename: string): ConfigData = ...
proc fromJson(filename: string): ConfigData = ...
proc fromXml(filename: string): ConfigData = ...
proc fromUnknown(filename: string): ConfigData =
  if filename.endsWith(".cfg"): fromConfig(filename)
  elif filename.endsWith(".json"): fromJson(filename)
  elif filename.endsWith(".xml"): fromXml(filename)
  else: ConfigData(... default values here, maybe ...)