Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language
https://scilla-lang.org
GNU General Public License v3.0
241 stars 79 forks source link

Dead code analysis for nested unused fields in contract adress types #1182

Open jubnzv opened 1 year ago

jubnzv commented 1 year ago

The dead code analyzer could be improved to support recursive definitions like these:

transition tr4
  (
    x :
      ByStr20 with contract
        field y : ByStr20 with contract
          field unused : Uint32, (* should be reported *)
          field used : Int32
        end
      end
  )
  a <-& x.y;
  b <-& a.used
end

See: https://github.com/Zilliqa/scilla/pull/1164#pullrequestreview-1135879512