I have a sequence of distinct types (despite all of them are actually int). I 
would like to "copy the types" into a new sequence. (Not looking for 
workarounds, because the problem is a little bit more involved)

Something as the following: 
    
    
    type
      A = distinct int
      B = distinct int
      C = A | B
    
    var d = newSeq[C](2)
    d[0] = 1.A
    d[1] = 1.B
    
    var e = newSeq[C](2)
    for idx, item in d:
      e[idx] = 5  # How do make "5" to be: `typeof(d[idx])`???
    
    
    Run

Reply via email to