It does if you have the same type
    
    
    type CommandId = enum
      cmdSearch
      cmdDownload
    
    type Command = object
      case id: CommandId
      of cmdSearch, cmdDownload:
        opts: int
    
    
    Run

Otherwise, there are several RFCs related to variants, sum types and ADTs:

  * <https://github.com/nim-lang/RFCs/issues/19>
  * <https://github.com/nim-lang/RFCs/issues/368>
  * <https://github.com/nim-lang/RFCs/issues/527>
  * <https://github.com/nim-lang/RFCs/issues/525>



at the very least.

Also @Araq has been working on a new design of ADTs in the past week.

Reply via email to