Zilliqa / scilla

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

False positives for unused nested library ADTs #1104

Closed anton-trunov closed 2 years ago

anton-trunov commented 2 years ago

The dead code detector for following contract

scilla_version 0

library Dead

type A = | A
type B = | B of A

contract Dead ()

transition Foo(x: B)
end

reports

warning: [3] Unused library ADT: A

This is a false positive: B is used since it's the type of a transition parameter and hence A is used because a value of type A is nested in a value of type B.