Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language

Home Page:https://scilla-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DeadCodeDetector: False positives for ADTs used after `TypeCast`

jubnzv opened this issue · comments

Here is a MRE:

scilla_version 0

library Dead5

type Ty =
  | Ty

contract Dead5 ()

transition Dead5()
  address = 0x0000000000000000000000000000000000000000;
  maybe_contract_address <-& address as ByStr20 with contract end;
  match maybe_contract_address with
  | None =>
  | Some _ =>
    ty = Ty (* Ty is marked as dead *)
  end
end

The problem is that the analysis cannot collect information about used ADTs that come after the TypeCast statement.

This causes the following problem: #1091 (comment)