Some months ago I did some plain tests with newruntime but gave up soon because 
of very basic bugs as

[https://github.com/nim-lang/Nim/issues/11356](https://github.com/nim-lang/Nim/issues/11356)

Now that many bugs are already fixed I tried a similar example again like this:
    
    
    type
      O = object
        i: int
      
      R = ref O
    
    proc main =
      var s: seq[owned R]
      s.add(R(i: 0))
      s.add(R(i: 1))
      #s[1] = nil
      s.delete(1)
      s[0] = R(i: 7)
      echo s[0].i
    
    main()
    
    
    Run
    
    
    /home/stefan/Nim/lib/system.nim(2144, 46) Error: '=' is not available for 
type <owned R>; requires a copy because it's not the last read of 'x[j144802 + 
1]'; routine: delete
    
    
    Run

Do we have an idea what the problem with delete is? Setting the ref to nil 
seems to compile.

(I can not remember why I tried code like that at all some months ago, I guess 
it was related somehow to using gintro with newruntime. Maybe that is indeed 
stupid code which will never occur in real Nim programming...)

Reply via email to