nim-lang / compilerdev

This repository contains a collection of documents about how to change/refactor the Nim compiler in order to make it faster, easier to maintain and have fewer bugs by a superior architecture and design. However, no every idea here will work out.
10 stars 3 forks source link

`sfAddrTaken` not set for array `a` on `a[0].addr` #12

Open timotheecour opened 4 years ago

timotheecour commented 4 years ago

@Araq low priority but I noticed the following while working on some PR; is the following a bug? sfAddrTaken is not set for array a on a[0].addr even though a and a[0].addr have the same address.

when true: # D20200711T150822
  proc main() =
    var a = [0,1]
    let a1 = a[0].addr # this does not set `sfAddrTaken` on `a`address
    let a2 = a.addr # this does set `sfAddrTaken` on `a`
Clyybber commented 4 years ago

sfAddrTaken will probably be removed: https://github.com/nim-lang/Nim/pull/14881#issuecomment-654109418

Araq commented 4 years ago

Exactly.