This commit is contained in:
Timothee Cour 2020-04-05 15:24:35 -07:00 • committed by GitHub
commit f1fd3ef7f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 31 deletions

View file

@ -59,4 +59,13 @@ static:
static: # bug #8402
type R = ref object
var empty: R
let otherEmpty = empty
let otherEmpty = empty
block:
# fix https://github.com/timotheecour/Nim/issues/88
template fun() =
var s = @[10,11,12]
var a = s[0].addr
a[] += 100 # was giving SIGSEGV
doAssert a[] == 110
static: fun()